- 1
border-color: #dadada #ebebeb #ebebeb #dadada;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+119
border-color: #dadada #ebebeb #ebebeb #dadada;
CSS. Встречено в проекте, разработчики с пост-совка :)
−169
// Функция возвращает округленное значение общего количества продуктов питания.
//
// Параметры:
// Число - число, которое необходимо округлить.
// Порядок - число, порядок округления.
Функция УППБУ_Округлить(Число, ПорядокОкругления) Экспорт
Порядок = Число(Строка(ПорядокОкругления));
..........
КонецФункции
Тиражное решение от одного из партнеров...
+153
/**
* you known..
* here you find great music: http://www.youtube.com/watch?v=0lTKErnmmoA
*
* good, yeah? :)
*
*/
$controller = self::call($controllerName);
$controller->preLoad();
$controller->runBefore();
+20
#include <iostream>
enum Quiet { LOG };
template<typename T>
Quiet operator <<(Quiet o, T) {
return o;
}
static inline Quiet operator <<(Quiet o, std::ostream &(*)(std::ostream &)) {
return o;
}
int main() {
LOG << "Hello world!" << std::endl;
return 0;
}
Измыслил сегодня вот такую вот затычку для выключения логгирования
+104
|| Request.UserAgent.ToLower().Contains("WindowsPhone")
|| Request.UserAgent.ToLower().Contains("LG"))
Пытаемся определить с мобильного ли устройства заходим на сайт. :)
+130
public ICommand StartCommand
{
get
{
if (this.startCommand == null)
{
this.startCommand = new DelegateCommand(() =>
{
Thread t = new Thread(StartServer);
t.Start();
});
}
return this.startCommand;
}
}
public ICommand EndCommand
{
get
{
if (this.endCommand == null)
{
this.endCommand = new DelegateCommand(() =>
{
Thread t = new Thread(EndServer);
t.Abort();
});
}
return this.startCommand;
}
}
Команды для кнопочек запуска и остановки сервера
−166
SELECT DISTINCT d.ageing as predicateid,
CONCAT(
TRIM(
TRIM(TRAILING "года" FROM
TRIM(TRAILING "лет" FROM
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(d.ageing, "не более ", "lte"),
"не менее ","gte"),
"более ", "gt"),
"от ", "gt"),
"до ", "lt"),
"около ", "ab"),
"менее ", "lt")
)
)
),
"ag") as nodecode, ...
+133
if (SellMenuEnable)
{
GUI.Box (new Rect (Screen.width/2 - 200, Screen.height/2 - 300, 400, 480),"");
if (GUI.Button (new Rect (Screen.width/2 + 180, Screen.height/2 - 300, 20, 20), "X" ))
{
SellMenuEnable = false;
}
// ШМОТКИ слево
if (SLOT1)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 270, 160, 50),"1");
}
if (SLOT3)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 210, 160, 50),"3");
}
if (SLOT5)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 150, 160, 50),"5");
}
if (SLOT7)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 90, 160, 50),"7");
}
if (SLOT9)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 - 30, 160, 50),"9");
}
if (SLOT11)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 + 30, 160, 50),"11");
}
if (SLOT13)
{
GUI.Box (new Rect (Screen.width/2 - 170, Screen.height/2 + 90, 160, 50),"13");
}
// ШМОТКИ с права
if (SLOT2)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 270, 160, 50),"2");
}
if (SLOT4)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 210, 160, 50),"4");
}
if (SLOT6)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 150, 160, 50),"6");
}
if (SLOT8)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 90, 160, 50),"8");
}
if (SLOT10)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 - 30, 160, 50),"10");
}
if (SLOT12)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 + 30, 160, 50),"12");
}
if (SLOT14)
{
GUI.Box (new Rect (Screen.width/2 + 10, Screen.height/2 + 90, 160, 50),"14");
}
}
http://unity3d.ru/distribution/viewtopic.php?f=105&t=16515
+69
public static String generateName(String baseName, int length) {
if (length < 1) {
length = Math.abs(length);
}
if(length == 0){
length = 1;
}
if (length > 36) {
length = length % 36;
}
return baseName + "_" + UUID.randomUUID().toString().substring(0, length).replaceAll("[-]", "");
}
Должна была быть генерация строки заданной общей длины с пятизначным хешем в конце.
+132
int count = _repository.GetObjectList().Select(x => x).Where(x => x.Id > 4).Count();
Sql style