- 1
http://habrahabr.ru/post/244487/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−407
http://habrahabr.ru/post/244487/
Очень жаль всех этих людей, которые вынуждены писать на этом выхлопе от Apple.
"Мыши плакали, кололись, но продолжали грызть кактус."
+160
<script language=php>
use function yolo\y;
yolo\yolisp(y('yolo\yolo',
y('lambda', y('request'),
y('new', YoLo\resPONsE::clASS, y(
y('quote', 'yolo')
))
)
));
%>
Микрофреймворк будущего: https://github.com/igorw/yolo
+161
function kevinTheNumberMentioner(_){
l=[]
/* mostly harmless --> */ with(l) {
//Sorry about all this, my babel fish has a headache today...
for (ll=!+[]+!![];ll<_+(+!![]);ll++) {
lll=+!![];
while (ll%++lll);
//I've got this terrible pain in all the semicolons down my right-hand side
(ll==lll)&&push(ll);
}
forEach(alert);
}
//You're really not going to like this...
return [!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]];
}
Открыл твитор, а там - это.
http://arstechnica.com/information-technology/2014/11/holiday-reading-for-a-certain-sort-if-hemingway-wrote-javascript/
+154
<?
class user
{
function login($name, $password)
{
$name = mysql_real_escape_string($name);
$name = htmlspecialchars($name);
$password = mysql_real_escape_string($password);
$password = htmlspecialchars($password);
$sql = mysql_query("SELECT id FROM students WHERE Names='$name' AND Pass='$password'");
if (mysql_num_rows($sql) == 1)
{
$_SESSION['Name'] = $name;
return 1;
}
else
{
return 0;
}
}
Код от ТЫЖпрограммиста.
+80
procedure TInventory.removeItem(userid: integer; invid: integer;amount: integer = 1);
var
MyRes: TInvItemArray;
CurrItem: TInvItem;
I,len: integer;
begin
if (amount <= 0) then
exit;
if (amount = 1) then
begin
db.removeItemFromUserInventory(GetItems(GetIndexByInvId(invid)),userid);
FInventoryList.Remove(GetIndexByInvId(invid));
end else
begin
if (amount >= finventorylist.Size) then
exit;
MyRes:=GetResources(invid);
len:=length(myres);
if (len = 0) then
exit;
if (amount > len) then
exit;
for i:=0 to len - 1 do
begin
curritem:=MyRes[i];
db.removeItemFromUserInventory(GetItems(GetIndexByInvId(curritem.InvId)),userid);
FInventoryList.Remove(GetIndexByInvId(curritem.invid));
end;
Setlength(myres,0);
end;
end;
function TInventory.GetResources(invid: integer): TInvItemArray;
function ToResult(var Return: TInvItemArray; const Item: TInvItem): Integer;
begin
Result := Length(Return);
SetLength(Return, Result + 1);
Return[Result] := Item;
end;
var
item,sameitem: TInvItem;
Resource: TItem;
i: integer;
begin
SetLength(result,0);
item:=GetItem(invid);
if (item = nil) then
exit;
if (item.item <> nil) then
begin
// if (item.itemю = 30) then
// begin
for i:=0 to FInventoryList.Size - 1 do
begin
sameitem:=TInvItem(FInventoryList.Items[i]);
if (sameitem = nil) then
continue;
resource:=sameitem.item;
if (resource = nil) then
continue;
if (item.item.itemid = resource.itemid) then
ToResult(result,sameitem);
end;
// end;
end;
end;
По сути - удалить объект из списка. OMG!
+154
var coutryOption = commonSettings.parent().parent().parent().find("tr:contains('Country')");
очень поиск...
+134
private bool CompareLvlCats(string[] cat,List<string[]> cats, int lvl)
{
if (lvl == 1) return cats.Find(x => x[0] == cat[0] && (x[1] != cat[1] ||x[1]!="")) != null;
if (lvl == 2) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && (x[2] != cat[2] || x[2] != "")) != null;
if (lvl == 3) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && (x[3] != cat[3] || x[3] != "")) != null;
if (lvl == 4) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && x[3] == cat[3] && (x[4] != cat[4] || x[4] != "")) != null;
if (lvl == 5) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && x[3] == cat[3] && x[4] == cat[4] && (x[5] != cat[5] || x[5] != "")) != null;
if (lvl == 6) return false;
return false;
}
Здесь мы идём снова.
+158
var firstpostime = 1417254005;var numpos = 1; //номер посещения
var sredvrem = 0; //среднее время на каждой странице
var lasdo15sek = 0;
function debug444(ff) {
console.log(ff);
//alert(ff);
}
var newTxt="!!";
var oldTxt=document.title;
function migalka(){
if(document.title==oldTxt){
document.title=newTxt;
}else{
document.title=oldTxt;
}
}
function neuspeli() {
var element55577 = document.createElement('div');
element55577.innerHTML = '<img style="width:1px;height:1px;" src="http://rbcall.com/neuspeli.php?&tel='+document.getElementById('wi_tele233').value+'&site=47&user=159">',
element55577.id = 'wi_r223';
document.body.appendChild(element55577);
document.getElementById("superjalobal").style.display='block';
}
function jduzvonka() {
if (zvonim == 1) { return true; }
if(document.getElementById("wi_tele233").value.length>=8 || document.getElementById("wi_tele233").value == 400){
wiyacall();
insertscript(document.getElementById("wi_tele233").value);
} else {
document.getElementById("wi_tele233").style.border="1px solid red";
}
}
...... и весь скрипт такой
http://rbcall.com/ ROBOCALL - технологии будущего (они же: технологии ИИ)
+162
(strrev "hello") #=> "olleh"
(array_sum [array 1 2 3]) #=> 6
(array-product [array 4 5 6]) #=> 120
(substring "world" 2) #=> "rld"
Теперь ваш Lisp и в PHP: https://github.com/lisphp/lisphp
+51
PVOID ZDbgDoc::getVaByName(PCSTR name)
{
PLIST_ENTRY head = &_dllListHead, entry = head;
while ((entry = entry->Flink) != head)
{
ZDll* pDll = static_cast<ZDll*>(entry);
if (PWSTR ImageName = pDll->_ImageName)
{
PCSTR sz = name;
__loop:
int c = tolower(*sz++);
if (!c || c != towlower(*ImageName++))
{
continue;
}
if (c != '.')
{
goto __loop;
}
pDll->Parse(this);
return pDll->getVaByName(sz, this);
}
}
return 0;
}