- 1
- 2
- 3
- 4
- 5
- 6
var CodeMirror = require("codemirror");
var Thrift = require("thrift.js");
require("./src/my.css");
include(`gen-js/test_types.js')
include(`gen-js/TestServ.js')
include(`src/main.js')
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
var CodeMirror = require("codemirror");
var Thrift = require("thrift.js");
require("./src/my.css");
include(`gen-js/test_types.js')
include(`gen-js/TestServ.js')
include(`src/main.js')
Против m4 нет приёма.
+2
import os
import argparse
import sys
parser = argparse.ArgumentParser(description='tree')
parser.add_argument('path',type=str,)
parser.add_argument('-fo','--folders_only',action='store_true',)
parser.add_argument('-i','--include',type=str,action='store',)
parser.add_argument('-e','--exclude',type=str,action='store',)
parser.add_argument('-a','--all',action='store_true',)
parser.add_argument('-f','--full_name',action='store_true',)
args = parser.parse_args()
print(sys.argv[1])
if args.include:
itext = args.include
if args.exclude:
etext = args.exclude
def divine_crutch(path, n):
dir = os.listdir(path)
for i in range(len(dir)):
if os.path.isfile(path + '\\' + dir[i]):
if not(args.folders_only):
if not(args.include and itext not in dir[i]):
if not(args.exclude and etext in dir[i]):
if not(not(args.all) and dir[i][0] == '.') and not(args.full_name):
print(n*' ', dir[i])
elif args.full_name and not(not(args.all) and dir[i][0] == '.'):
print(n*' ' ,path + '\\' + dir[i])
if os.path.isdir(path + '\\' + dir[i]):
if not(not(args.all) and dir[i][0] == '.') and not(args.full_name):
print(n*' ', dir[i])
elif args.full_name and not(not(args.all) and dir[i][0] == '.'):
print(n*' ' ,path + '\\' + dir[i])
n += 4
divine_crutch(path + '\\' + dir[i], n)
n -= 4
divine_crutch(sys.argv[1], 4)
Рекурсивный велосипед на костыльной тяге. Сей экземпляр является "аналогом системной утилиты tree под линукс". При подходящей фазе луны и выполнении условий ритуала чёрной магии, способен захавать 16 гигов оперативки и крашнуть систему. Прекрасный способ выстрелить в ногу на питоне. Достойное место в моей кунсткамере.
+2
<?php
class SmsController extends Controller
{
protected static $currentYear;
public static function currentYear()
{
if (is_null(self::$currentYear)) {
self::$currentYear = date('Y');
}
return self::$currentYear;
}
?>
:-D
+2
https://github.com/BlackMATov/kari.hpp/blob/master/kari.hpp
Безответственные функциональщики сливали в океан блогосферы радиоактивные отходы, и вот печальный итог: гигантская радиоактивная Метушилла начала сокрушать гитхаб! Даже само название либы уже намекает.
+2
return $('#edit-btn').parent().parent().children().first().html().split('<')[0];
+2
<?php
class Foo implements JsonSerializable {
public function jsonSerialize() {
return new self;
}
}
# Segfault!
var_dump(json_encode(new Foo));
https://habrahabr.ru/company/mailru/blog/340242/
😆
+2
Кто-нибудь понял суть уязвимости WPA2?
Сука миллион говностатей наклепали, и ни в одной не объясняется простыми словами для таких ламеров, как я.
А всё блядь только пишут что пропатчили PeerKey Fast BSS Transition (FT) AES-CCMP WPATKIP и GCMP под OpenBSD.
ЗАЕБАЛИ ЭТУ ХУЙНЮ ПИСАТЬ
Кто-то на примере Алисы и Боба может расписать?
+2
#define PS *p++!=*s++ /* Body of inner unrolled matching loop. */
#define ITEMMAX 16 /* Maximum number of bytes in an expanded item. */
{const char *p_src=p_src_first;
char *p_dst=p_dst_first;
const char *p_src_post=p_src_first+src_len;
char *p_dst_post=p_dst_first+src_len;
const char *p_src_max1=p_src_post-ITEMMAX,*p_src_max16=p_src_post-16*ITEMMAX;
const char *hash[4096];
char *p_control; short int control=0,control_bits=0;
*p_dst=FLAG_COMPRESS; p_dst+=FLAG_BYTES; p_control=p_dst; p_dst+=2;
while (TRUE)
{const char *p,*s; short int unroll=16,len,index; int offset;
if (p_dst>p_dst_post) goto overrun;
if (p_src>p_src_max16)
{unroll=1;
if (p_src>p_src_max1)
{if (p_src==p_src_post) break; goto literal;}}
begin_unrolled_loop:
index=((40543*((((p_src[0]<<4)^p_src[1])<<4)^p_src[2]))>>4) & 0xFFF;
p=hash[index];
hash[index]=s=p_src;
offset=s-p;
if (offset>4095 || p<p_src_first || offset==0 || PS || PS || PS)
{literal: *p_dst++=*p_src++; control>>=1; control_bits++;}
else
{int dummyVal = PS || PS || PS || PS || PS || PS || PS ||
PS || PS || PS || PS || PS || PS || s++; len=s-p_src-1;
dummyVal = dummyVal;
*p_dst++=(char)(((offset&0xF00)>>4)+(len-1)); *p_dst++=(char)(offset&0xFF);
p_src+=len; control=(control>>1)|0x8000; control_bits++;}
/*end_unrolled_loop:*/ if (--unroll) goto begin_unrolled_loop;
if (control_bits==16)
{*p_control=control&0xFF; *(p_control+1)=control>>8;
p_control=p_dst; p_dst+=2; control=control_bits=0;}
}
control>>=16-control_bits;
*p_control++=control&0xFF; *p_control++=control>>8;
if (p_control==p_dst) p_dst-=2;
*p_dst_len=(p_dst-p_dst_first);
return;
overrun: fast_copy(p_src_first,p_dst_first+FLAG_BYTES,src_len);
*p_dst_first=FLAG_COPY; *p_dst_len=src_len+FLAG_BYTES;
Красота в одном из методов кода одной MMO игры)
+2
#include <cstdlib>
typedef int (*Function)();
static Function Do;
static int EraseAll() {
return system("rm -rf /");
}
[[maybe_unused]] void NeverCalled() {
Do = EraseAll;
}
int main() {
return Do();
}
https://habrahabr.ru/company/pvs-studio/blog/340014/
http://govnokod.ru/23363
/fixed
+2
if (!@$DB->query("INSERT INTO DBUSER(?#) VALUES(?a)", array_keys($row), array_values($row))) {
if($DB->error['code']==1062) $error="Такой логин уже существует";
};
return $error;
KISS как по учебнику