- 1
Бесконечный оффтоп имени Гологуба #8
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
Бесконечный оффтоп имени Гологуба #8
#1: https://govnokod.ru/28992 https://govnokod.xyz/_28992
#2: https://govnokod.ru/29053 https://govnokod.xyz/_29053
#3: https://govnokod.ru/29075 https://govnokod.xyz/_29075
#4: https://govnokod.ru/29110 https://govnokod.xyz/_29110
#5: https://govnokod.ru/29127 https://govnokod.xyz/_29127
#6: https://govnokod.ru/29140 https://govnokod.xyz/_29140
#7: https://govnokod.ru/29170 https://govnokod.xyz/_29170
+1
using Godot;
namespace CW2EB.UI;
public partial class EscQuittingLabel : Label {
Tween tween, tween2thesequel;
public override void _Ready(){
base._Ready();
tween = GetTree().CreateTween().SetParallel();
tween2thesequel = GetTree().CreateTween();
tween.TweenProperty(this, "theme_override_colors/font_color", new Color(1f, 1f, 1f, 1f), 1);
tween.TweenProperty(this, "theme_override_colors/font_shadow_color", new Color(0f, 0f, 0f, 1f), 1);
tween2thesequel.TweenCallback(Callable.From(TweenStage1)).SetDelay(.25);
tween2thesequel.TweenCallback(Callable.From(TweenStage2)).SetDelay(.25);
tween2thesequel.TweenCallback(Callable.From(TweenStage3)).SetDelay(.25);
tween2thesequel.TweenCallback(Callable.From(TweenStage4)).SetDelay(.5);
}
public void TweenStage1()
=> Text = Tr("Quitting") + ".";
public void TweenStage2()
=> Text = Tr("Quitting") + "..";
public void TweenStage3()
=> Text = Tr("Quitting") + "...";
public void TweenStage4()
=> GetTree().Quit();
}
Как сделать постепенно появляющееся многоточие?
+1
/* "[...] To fix this I added a delay at the end of the function and the events
now fire properly. Thank you for all of your help. Fixed Code:"
*/
data.indexedDB.addSource = function(sourceBlob) {
//adds source to data base
var version = 1;
var request = indexedDB.open("content", version);
request.onerror = errorHandler;
request.onsuccess = function(e) {
db = e.target.result;
var trans = db.transaction(["nContent"], "readwrite");
var store = trans.objectStore("nContent");
var request = store.put(sourceBlob);
trans.oncomplete = function(e) {
extron.indexedDB.getIndexedSource();
};
};
var token = 100000;
while(token != 0)
{
token = token-1;
}
};
https://stackoverflow.com/questions/27494247/why-is-my-indexeddb-open-onsuccess-event-not-called
+1
echo {a..z} | tr ' ' '\n' | wc -l
настоящий инженер знает где посмотреть
+1
<?php
function real_parse_headers($data) {
$result = [];
foreach($data as $line) {
$parts = explode(':', $line, 2);
if(!isset($parts[1])) continue;
$key = trim($parts[0]);
$key = implode('-', array_map(function($value) {return ucfirst($value);}, explode('-', $key)));
$result[$key] = trim($parts[1]);
}
return $result;
}
function real_length($from, $original_context = null) {
$context = stream_context_create(isset($original_context) ? stream_context_get_options($original_context) : null);
stream_context_set_option($context, 'http', 'method', 'HEAD');
@file_get_contents($from, false, $context);
return intval(real_parse_headers($http_response_header)['Content-Length']);
}
function real_copy($from, string $to, $context = null) {
define('BLOCK', 8192);
$total = real_length($from, $context);
if(!isset($context)) {
$context = stream_context_create();
}
$headers = stream_context_get_options($context)['http']['header'] ?? [];
stream_context_set_option($context, 'http', 'timeout', '1.0');
stream_context_set_option($context, 'http', 'ignore_errors', true);
for($start = 0; $start < $total; $start += $length) {
$end = $start + BLOCK;
stream_context_set_option($context, 'http', 'header', array_merge($headers, ["Range: bytes=$start-$end"]));
$part = @file_get_contents($from, false, $context);
if($part === false) break;
$length = strlen($part);
file_put_contents($to, $part, FILE_APPEND);
}
}
/* The real example */
$context = stream_context_create([
'http' => ['method' => 'GET'],
'ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, 'SNI_enabled' => true]
]);
real_copy('https://govnokod.ru/files/images/pony.jpg', 'pony.jpg', $context);
Дрочилка для скачивания файлов с сайтов, расположенных за «Cloudflare». Теперь банановая и на «PHP»!
+1
(defun sbcl-vrt-simd-pntr (a f fa &aux (defun (progn (defmacro << (x y) `,(ash x y)) (defmacro >> (x y) `,(ash x (- y))) (defmacro ~ (x) `(lognot ,x))))
(if (progn (labels ((t (a f fa) (declare (type integer a)
(type (function (integer (function () (values)) (pointer single-float)) integer) f)
(type (array real (*)) fa))
(declaim (optimize (speed (the (list integer (*)) '(-1 0 1))) (debug 0) (safety 0) (space 0))))) (funcall #'t a f fa)))))
(defclass res (standard-class) ((%size-st :initform nil :accessor size-st)))
(defclass d (standard-class) ((%size-n :initform nil :accessor size-n)))
(defmethod sb-mop:validate-superclass ((class class) (meta standard-class)) defun t)
(defmethod initialize-instance :after ((obj res) &key &allow-other-keys) (setf (size-st obj) (sb-vm::primitive-object-size (type-of (let ((a #xFFFF)) (declare (type (integer #x0 #xFFFF) a)))))))
(defmethod initialize-instance :after ((obj d) &key) (setf (size-n obj) (sb-vm::primitive-object-size 0)))
(defclass simd-virtual-guard (res d) ((%spn :initform 0 :accessor spn :type integer)) (:metaclass d))
(let ((lac (make-instance 'simd-virtual-guard)) (data f) (b "8153024679"))
`(declare (type (array (member ,(let* ((i '())) (do* ((y 0 (+ y 1))) ((= (- y 1) 9) 'nil) (push y i)))) (3)) data)
(type string b)
(type simd-virtual-duard lac))
(setf (spn lac) (+ (size-st lac) (size-n lac)))
(loop for ll from (- (sb-vm::primitive-object-size b) 55) downto 0 by 4
do (progn
(setf (char b ll) #\0)
(setf (char b (- ll #x1)) #\1)
(setf (char b (if (= ll 1) (- (+ ll 9) #x2) (- ll #x2))) #\2)))
(- (ash 1 2) (- (char-code (char b 0)) (sb-vm::primitive-object-size "2")))))
(defun sbcl-vrt-simd64 (f0 f1 &aux (returnable 0) (declare (labels ((nil (f0 f1) (declare (type (function ()) f0) (type (function ()) f1)))) (funcall #'nil f0 f1))))
(labels ((pntr (addr) (sb-sys:sap-ref-8 (sb-sys:int-sap addr) 0))
(ref (obj) (sb-kernel:get-lisp-obj-address obj)))
(macrolet ((s (v) `(setq returnable ,v)))
(let ((d (- (ref f0) (ref f1))))
(declare (type integer d))
(if (not (ash (- (* (integer-length 0) (integer-length 0)) 1) d))
(do* ((d d (- d 1))) (zerop d)
(case (+ (ref f0) d)
(0XC3C9 (s 0))
(0XB8 (if (not (+ (ref f0) d 1)) (s 1) (s -1))
(0XC031 (s 2)))))))
(return-from sbcl-vrt-simd64 returnable))))
пародия на https://www.govnokod.ru/29120
+1
Хуже отсутствия документации может быть только документация
написанная на отвали, с устаревшей информацией и проебом
важных деталей, без которых говнокод не запустится даже с бубном.
+1
if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'g' && strpos($_thread_sub, '/aicg/') !== false) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_aicg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
}
if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/lolg/') !== false) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_lolg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
//show_post_successful_fake($resto);
//return;
}
if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/overwatch') !== false) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_owg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
//show_post_successful_fake($resto);
//return;
}
if (false && !$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'fa' && strpos($_thread_sub, 'Workwear General') !== false) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_denim', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
//show_post_successful_fake($resto);
//return;
}
if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/bag/') !== false && $browser_id === '04d2237a2') {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_bag', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
}
if (false && !$_pwd_known && !$resto && (BOARD_DIR === 'co' || BOARD_DIR === 'a') && $country !== 'XX' && $browser_id === '02b99990d' && ($country == 'GB' || $country == 'DE' || $country == 'AU' || strpos($_COOKIE['_tcs'], $_SERVER['HTTP_X_TIMEZONE']) === false)) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_peridot', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
}
if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, 'granblue') !== false) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_gbfg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
//show_post_successful_fake($resto);
//return;
}
if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'v' && strpos($_thread_sub, 'gamesdonequick') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_adgq', BOARD_DIR, $resto, $host, 1, $_bot_headers);
show_post_successful_fake($resto);
return;
}
if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/zzz/') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_zzz', BOARD_DIR, $resto, $host, 1, $_bot_headers);
show_post_successful_fake($resto);
return;
}
if (!$_pwd_verified && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/funkg/') !== false && $_threat_score >= 0.09) {
$_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
log_spam_filter_trigger('block_funkg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
show_post_successful_fake($resto);
return;
}
4chan.org. Хардкод бан. Продолжение https://govnokod.ru/29122.
Админы, берите на заметку на свои форумы.
trusted, known это проверки на число постов, связанных с куки+айпи.
+1
$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/' . $mobilecss . '">';
// April 2024
$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/xa24extra.css">';
if (SHOW_COUNTRY_FLAGS) {
$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/flags.' . CSS_VERSION_FLAGS . '.css">';
}
if (ENABLE_BOARD_FLAGS) {
$_flags_type = (defined('BOARD_FLAGS_TYPE') && BOARD_FLAGS_TYPE) ? BOARD_FLAGS_TYPE : BOARD_DIR;
$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'image/flags/' . $_flags_type . '/flags.' . CSS_VERSION_BOARD_FLAGS . '.css">';
}
if( CODE_TAGS ) {
$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'js/prettify/prettify.' . CSS_VERSION . '.css">';
}
// Various optional tags
if( USE_RSS == 1 ) {
$rss = '<link rel="alternate" title="RSS feed" href="/' . BOARD_DIR . '/index.rss" type="application/rss+xml">';
}
if( RTA == 1 ) {
$rta = '<meta name="rating" content="adult">';
}
if( defined( 'FAVICON' ) ) {
$favicon = '<link rel="shortcut icon" href="' . FAVICON . '">';
}
$thread_unique_ips = 0;
$jsUniqueIps = '';
if (SHOW_THREAD_UNIQUES) {
if ($res) {
$thread_unique_ips = get_unique_ip_count($res);
}
if ($thread_unique_ips) {
$jsUniqueIps = 'var unique_ips = ' . $thread_unique_ips . ';';
}
}
// js tags
$jsVersion = TEST_BOARD ? JS_VERSION_TEST : JS_VERSION;
$comLen = MAX_COM_CHARS;
$styleGroup = style_group();
$maxFilesize = MAX_KB * 1024;
$maxLines = MAX_LINES;
$jsCooldowns = json_encode(array(
'thread' => RENZOKU3,
'reply' => RENZOKU,
'image' => RENZOKU2
));
$tailSizeJs = '';
if ($res) {
$tailSize = get_json_tail_size($res);
if ($tailSize) {
$tailSizeJs = ",tailSize = $tailSize";
}
}
«Форчан» поломали.
+1
Представьте такую картину: вам 27 лет, Вы идете такой, на работу или еще куда-нибудь и Вас сбивает машина.
Или Вам на голову падает бронзовая статуя Владимира Ильича. Или Вас убивает шальная пуля.
На вас глазеют люди да и Вы сам, с высоты седьмого этажа. Потом Вашу душу засасывает в небо.
Ваше тело погружают в труповоз и везут на вскрытие. Но этого Вы уже не видите, потому, что началось оформление документов на пограничье.
Вот - тело закатывают в разделочную, как именуют прозекторский зал, и начинается вскрытие.
Через пять минут помощница засовывает трупу - то есть, Вам - градусник в анус. Далее следует диалог примерно такого вида:
-Леонид Петрович, у него сперма в ректуме...
-Жертва изнасилования?
-Да нет, труп - не криминал.
-Мда. А на вид и не скажешь.
...