- 1
- 2
my ($new_framed_ip) = @actets[0]."."1".".@actets[2].".".@actets[3];
$framed_ip = $new_framed_ip;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−146
my ($new_framed_ip) = @actets[0]."."1".".@actets[2].".".@actets[3];
$framed_ip = $new_framed_ip;
+29.4
var req_date = document.getElementById('requested_date').value.split('-');
if (req_date.length!=3 || new Number(req_date[0])<1990 || new Number(req_date[0])>2100
|| new Number(req_date[1])<1 || new Number(req_date[1])>12 || new Number(req_date[2])<1) {
alert('Requested date is not valid, please re-enter.');
return false;
}
var ef_date = document.getElementById('effective_date').value.split('-');
if (ef_date.length!=3 || new Number(ef_date[0])<1990 || new Number(ef_date[0])>2100
|| new Number(ef_date[1])<1 || new Number(ef_date[1])>12 || new Number(ef_date[2])<1) {
alert('Effective date is not valid, please re-enter.');
return false;
}
var ex_date = document.getElementById('expiration_date').value.split('-');
if (ex_date.length!=3 || new Number(ex_date[0])<1990 || new Number(ex_date[0])>2100
|| new Number(ex_date[1])<1 || new Number(ex_date[1])>12 || new Number(ex_date[2])<1) {
alert('Expiration date is not valid, please re-enter.');
return false;
}
var month_days = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
if (new Number(req_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(req_date[2])>month_days[new Number(req_date[1])-1]) ) {
alert('Requested date is not valid, please re-enter.');
return false;
}
if (new Number(ef_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(ef_date[2])>month_days[new Number(ef_date[1])-1]) ) {
alert('Effective date is not valid, please re-enter.');
return false;
}
if (new Number(ex_date[0])%4) {
month_days[1] = 28;
}
if ((new Number(ex_date[2])>month_days[new Number(ex_date[1])-1]) ) {
alert('Expiration date is not valid, please re-enter.');
return false;
}
и такого там много.. еще на PHP скину
+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
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 это проверки на число постов, связанных с куки+айпи.
+2
-- add crafting exp
function addCExp(amount)
...
-- add cooking exp
function addCexp(amount)
если петух скопипастил твой код, и сделал две такие функции, то сколько раз за час интенсивного кодинга ты их перепутаешь?
(язык изменён)
−2
echo $(ls *.txt) | sed s/\ /,/
А потому шо
ls *.txt | sed s/\ /,/0
#include <iostream>
#include <vector>
#include <string>
int main()
{
int n = 6;
std::vector<int> vec;
for (int i = 0; i < n; i++)
{
if ((i % 2) == 0)
{
std::reverse(vec.begin(), vec.end());
}
vec.push_back(i);
if ((i % 2) != 0)
{
std::reverse(vec.begin(), vec.end());
}
for (int j = 0; j < vec.size(); j++)
{
std::cout << vec[j] + 1;
if (j != vec.size() - 1)
{
std::cout << "-";
}
}
std::cout << "\n";
}
}
Цель напечатать на экране следующее:
1
2-1
1-2-3
4-3-2-1
1-2-3-4-5
6-5-4-3-2-1
насколько это говнокод от 0 до 10?
0
https://pvs-studio.com/ru/blog/posts/cpp/0094/
−7
// @strict: true
interface IFace {
cond0: boolean;
cond1?: boolean;
}
function main() {
const a : IFace = { cond0: true };
print (a.cond0);
print (a.cond1 == undefined);
print (a.cond1);
// a.cond1?.value
print("done.");
}
я вам принес новую фичу. называется опциональные поля в interface-ах. а твой с++ умеет так?
+1
namespace Ifaces {
interface IFoo {
foo(): number;
}
}
class Cls1 implements Ifaces.IFoo
{
foo(): number
{
print("Hello");
return 1;
}
}
function main()
{
const cls1 = new Cls1();
cls1.foo();
const ifoo: Ifaces.IFoo = cls1;
ifoo.foo();
}
Алилуя. я вам интерфейсы принес... узрите теперь дампик