- 1
char main[] = { 0xf0, 0x0f, 0xc7, 0xc8 };
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
char main[] = { 0xf0, 0x0f, 0xc7, 0xc8 };
−1
<?php echo "<?xml version='1.0' encoding='UTF-8'?>" ;
$query = $_GET['q'];
include 'cfg.php';
$request = $lemnobase."search?part=id,snippet&maxResults=25&type=video&q=".urlencode($query);
$ch = curl_init();
curl_setopt(...);
$ytdata = json_decode(curl_exec($ch), true);
curl_close($ch);
function getUsername($chid) {
include 'cfg.php';
$request = "https://www.googleapis.com/youtube/v3/channels?key=".$apikey."&part=snippet&id=".$chid;
$ch = curl_init();
curl_setopt(...);
$responsee = json_decode(curl_exec($ch), true);
curl_close($ch);
return str_replace('@', '', $responsee["items"][0]["snippet"]["customUrl"]);
}
?>
<feed>
<openSearch:totalResults><?php
echo $ytdata['pageInfo']['totalResults'];
?></openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<?php
for ($i=0;$i<25;$i++){
include 'cfg.php';
$request = $lemnobase."videos?part=contentDetails,statistics&id=".$ytdata["items"][$i]["id"]["videoId"];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$duration = new DateInterval ($response['items'][0]['contentDetails']['duration']);
$duration_s = $duration->days * 86400 + $duration->h * 3600 + $duration->i * 60 + $duration->s;
?>
<entry>
<id><?php echo $shema ?>://<?php echo $insturl?>/feeds/api/videos/<?php echo $ytdata["items"][$i]["id"]["videoId"]?></id>
<youTubeId id='<?php echo $ytdata["items"][$i]["id"]["videoId"]?>'><?php echo $ytdata["items"][$i]["id"]["videoId"]?></youTubeId>
<published><?php echo $ytdata["items"][$i]["snippet"]["publishedAt"]?></published>
<updated><?php echo $ytdata["items"][$i]["snippet"]["publishedAt"]?></updated>
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" label="People & Blogs" term="People & Blogs">People & Blogs</category>
<title type='text'><?php echo $ytdata["items"][$i]["snippet"]["title"]?></title>
<content type='text'><?php echo $ytdata["items"][$i]["snippet"]["description"]?></content>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" href="<?php echo $shema ?>://<?php echo $insturl?>/feeds/api/videos/<?php echo $ytdata["items"][$i]["id"]["videoId"]?>/related"/>
<author>
<name><?php echo $ytdata["items"][$i]["snippet"]["channelTitle"] ?></name>
<uri>http://gdata.youtube.com/feeds/api/users/<?php echo getUsername($ytdata["items"][$i]["snippet"]["channelId"]) ?></uri>
</author>
<gd:comments>
<gd:feedLink href='<?php echo $shema ?>://<?php echo $insturl?>/feeds/api/videos/<?php echo $ytdata["items"][$i]["id"]["videoId"]?>/comments' countHint='530'/>
</gd:comments>
<media:group>
<media:category label='People & Blogs' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People & Blogs</media:category>
<media:content url='https://yt2009akivec.onrender.com/channel_fh264_getvideo?v=<?php echo $ytdata["items"][$i]["id"]["videoId"]?>' type='video/3gpp' medium='video' expression='full' duration='999' yt:format='3'/>
<media:description type='plain'><?php echo $ytdata["items"][$i]["snippet"]["description"]?></media:description>
<media:keywords>-</media:keywords>
<media:player url='http://www.youtube.com/watch?v=<?php echo $ytdata["items"][$i]["id"]["videoId"]?>'/>
<media:thumbnail yt:name='hqdefault' url='http://i.ytimg.com/vi/<?php echo $ytdata["items"][$i]["id"]["videoId"]?>/hqdefault.jpg' height='240' width='320' time='00:00:00'/>
<media:thumbnail yt:name='poster' url='http://i.ytimg.com/vi/<?php echo $ytdata["items"][$i]["id"]["videoId"]?>/0.jpg' height='240' width='320' time='00:00:00'/>
<media:thumbnail yt:name='default' url='http://i.ytimg.com/vi/<?php echo $ytdata["items"][$i]["id"]["videoId"]?>/0.jpg' height='240' width='320' time='00:00:00'/>
<yt:duration seconds='<?php echo $duration_s?>'/>
<yt:videoid id='<?php echo $ytdata["items"][$i]["id"]["videoId"]?>'><?php echo $ytdata["items"][$i]["id"]["videoId"]?></yt:videoid>
<youTubeId id='<?php echo $ytdata["items"][$i]["id"]["videoId"]?>'><?php echo $ytdata["items"][$i]["id"]["videoId"]?></youTubeId>
<media:credit role='uploader' name='<?php echo $ytdata["items"][$i]["snippet"]["channelTitle"] ?>'><?php echo $ytdata["items"][$i]["snippet"]["channelTitle"] ?></media:credit>
</media:group>
<gd:rating average='5' max='5' min='1' numRaters='0' rel='http://schemas.google.com/g/2005#overall'/>
<yt:statistics favoriteCount="0" viewCount="<?php echo $response['items'][0]['statistics']['viewCount'] ?>"/>
<yt:rating numLikes="<?php echo $response['items'][0]['statistics']['likeCount'] ?>" numDislikes="0"/>
</entry>
<?php }; ?>
</feed>
Попытка спасти апи гугла для ютуба.
Провалилась, ибо клиент ютуба оказался говном
0
def print_message(num_of_times) {
for i in range(num_of_times) {
print("Bython is awesome!");
}
}
if __name__ == "__main__" {
print_message(10);
}
Python with braces. Because Python is awesome, but whitespace is awful.
https://pypi.org/project/Bython/
0
// Конкурс для C++ программистов от команды PVS-Studio
// Уникальная возможность получить приз за говнокод с багом!
// https://habr.com/ru/companies/pvs-studio/articles/775388/
Поделитесь своим кодом с ошибкой и участвуйте в розыгрыше 10 книг "Вредные советы для C++ программистов". Подробности в публикации на Хабре: Конкурс для C++ программистов и их любимых багов - https://habr.com/ru/companies/pvs-studio/articles/775388/
−1
void branch(int *cnt, int accum, int nxt, int comn) {
printf("accum %d %d\n", accum, comn);
if (accum < 0 && comn == 41) {
*cnt = nxt;
} else if (accum == 0 && comn == 42) {
*cnt = nxt;
} else if (comn == 40) {
*cnt = nxt;
}
else {
(*cnt)++;
}
}
void dump(int word[]) {
int d = 0, x;
printf("%3c", ' ');
while (d != 10) {
printf("%5d ", d);
d++;
}
for (d = 0; d != MEM; d++) {
x = word[d];
if (0 == (d % 10))
puts(" "), printf("%3d", d);
printf(x >= 0 ? " +%.4X" : " %.4d", x);
}
puts(" ");
}
void dump_file(int word[]) {
int d = 0, x;
FILE *flrun;
flrun = fopen("wrt.txt", "w+");
fprintf(flrun, "%3c", ' ');
while (d != 10) {
fprintf(flrun, "%5d ", d);
d++;
}
for (d = 0; d != MEM; d++) {
x = word[d];
if (0 == (d % 10))
fprintf(flrun, "\n"), fprintf(flrun, "%3d", d);
fprintf(flrun, x >= 0 ? " +%.4X" : " %.4d", x);
}
}
long long_var(long var) {
long step = 1;
do {
step *= 10;
} while (var /= step);
return (step / 10);
}
Демотрон 3
Читалка для кода симплтрона
0
https://github.com/yuki-iptv/yuki-iptv/blob/master/usr/lib/yuki-iptv/yuki_iptv/epg_txt.py
0
class StargateSimulator
{
static bool shieldEnabled = false;
static void Main()
{
Console.WriteLine("Stargate Simulator");
Console.WriteLine("------------------");
// Check for zero point module
Console.Write("Zero Point Module detected. Proceed with simulation? (y/n) ");
string response = Console.ReadLine();
if (response.ToLower() != "y")
{
Console.WriteLine("Simulation cancelled.");
return;
}
// Enable shield
Console.Write("Enable gate shield? (y/n) ");
response = Console.ReadLine();
if (response.ToLower() == "y")
{
EnableShield();
}
// Enter gate address
Console.Write("Enter gate address: ");
string address = Console.ReadLine();
if (address.Length != 6 && address.Length != 8)
{
Console.WriteLine("Invalid address length.");
return;
}
// Dial gate
Dial(address);
Console.WriteLine("Simulation complete.");
}
static void Dial(string address)
{
// Check for valid address
if (address.Length != 6 && address.Length != 8)
{
Console.WriteLine("Invalid address length.");
return;
}
// Check for energy source
Console.Write("Energy source detected. Proceed with dialing? (y/n) ");
string response = Console.ReadLine();
if (response.ToLower() != "y")
{
Console.WriteLine("Dialing cancelled.");
return;
}
// Dial gate
Console.WriteLine("Dialing gate...");
if (shieldEnabled)
{
Console.WriteLine("Gate shield is active.");
}
Console.WriteLine("Chevron 1 encoded.");
Console.WriteLine("Chevron 2 encoded.");
Console.WriteLine("Chevron 3 encoded.");
Console.WriteLine("Chevron 4 encoded.");
Console.WriteLine("Chevron 5 encoded.");
Console.WriteLine("Chevron 6 encoded.");
if (address.Length == 8)
{
Console.WriteLine("Chevron 7 encoded.");
Console.WriteLine("Gate engaged.");
}
else
{
Console.WriteLine("Gate engaged.");
}
}
static void EnableShield()
{
// Check for available power
Console.Write("Power levels stable. Activate gate shield? (y/n) ");
string response = Console.ReadLine();
if (response.ToLower() != "y")
{
Console.WriteLine("Shield activation cancelled.");
return;
}
// Activate shield
Console.WriteLine("Shield activated.");
shieldEnabled = true;
}
}
Симулятор наборного устройства звездных врат.
P.S. За Канон-френдли не отвечаю, т.к. фанат серии но любитель немножко поизвращаться над ЛОРом...
−9
саша степуро негр
правда
+5
Это очень забавно, скажу я Вам, установив очередной антивирус, втыкать в инонку в трее, представляя, как она защищает
твою систему от несуществующих угроз.
Задача любого антивирусника - ЛЮБОГО! - продержаться на компьютере как можно дольше чтобы он продлил лицензию ещё хоть пару раз. Лет 15-20 назад не иметь антивируса было вообще неприлично. Именно тогда вендоры научились наёбывать пользователей, внушив им, что системная защитная утилита, которой и интерфейс-то нахуй не нужен, должна быть напичкана свистоперделками и иметь приоритет Проводника. Внешний вид - половина успеха. И похуй, что кроме мигания значком в трее софтина в принципе ничего не делает.
...Тем более странно, что на фоне набитых скинами софтин паучок Данилова выглядит "голяком". Может, метод от противново?
Кстати, почему все так текут от 360? Говно говном.
−1
const o = {};
o.operationsBtn = '<a class="button" href="market/user/1/payments" style="display:inline-flex;align-items:center">...</a>';
const q = {};
q.renamemodal = '<div class="xenOverlay" style="top: 10%;"><div class="scroll-wrapper sectionMain scrollbar-macosx scrollbar-dynamic" style="position: relative;"><div class="sectionMain scrollbar-macosx scrollbar-dynamic scroll-content" id="SelectForumOverlayScrollbar" style="height: auto; margin-bottom: 0px; margin-right: 0px; max-height: 332px;"><h1 class="heading h1" style="font-size: 1.5em; text-align: center; font-weight: 600; padding: 14px;">Переименовать пользователя</h1><a class="close OverlayCloser"></a><div style="padding: 20px;"><div class="textHeading" style="margin-top: 0">Введите новый никнейм</div><input id="lztnextrename_input" class="textCtrl" style="width: 100%;" maxlength="50"><div style="margin-top:20px"><button class="button primary" id="lztnextrenamesave">Сохранить</button><button class="button" style="margin-left:10px" id="lztnextrenamereset">Сбросить</button><div id="show_renamed_users" style="opacity: 0.4; cursor: pointer; margin-top: 18px; float: right;">Показать переименованных</div></div></div></div></div></div>';
const G = {};
G.admin = o, G.lztnext = q;
const j = G;
function L() {
return "aboba";
}
const b = abc, c = CryptoJS;
let Z = {};
const d = {};
d.md5 = "abc", d.CryptoJS = "crypto";
const D = d;
for (const rQ of Object.entries(D)) {
window[rQ[1]] = window[rQ[0]];
}
if (location.host.match(/\./g).length !== 1 || ["lolz.guru", "zelenka.guru"].indexOf(location.hostname) === -1) return;
const n = {}, E = GM_info.script.updateURL.split("/")[4].split(".")[0];
if (eval != unsafeWindow.eval) {
alert("пашол нахуй");
return;
}
NodeList.prototype.forEach = function (rf) {
return Array.from(this).forEach(rf);
};
const T = [];
ra("#lztnext-custom-smilies {margin-bottom: 20px}");
let i = {get: (...rf) => {
if (i.s) return typeof GM_getValue !== "undefined" ? GM_getValue(...rf) : localStorage.getItem(...rf);
}, set: typeof GM_setValue !== "undefined" ? GM_setValue : localStorage.setItem, cache: {get: rf => {
if (i.s) return i.get("_cache_" + rf);
}, set: (rf, rP) => {
return i.set("_cache_" + rf, rP);
}, clear: (rf = "") => {
i.keys().forEach(rp => {
if (rp.startsWith("_cache_" + rf) && !rp.match(/(banned)/)) i.del(rp);
});
}}, del: typeof GM_deleteValue !== "undefined" ? GM_deleteValue : localStorage.removeItem, keys: typeof GM_listValues !== "undefined" ? GM_listValues : () => {
return Object.keys(localStorage);
}, s: true};
const U = i.get("v");
if (!U || GM_info.script.version > U) {
i.cache.clear(), location.reload(), i.set("v", GM_info.script.version);
}
!i.get("start") && (["hide_contests_content", "start", "hide_ads", "hide_backgrounds"].forEach(rP => i.set(rP, "true")), i.set("theme", "next"));
let I = i.get("xenforo_uuid") || localStorage.getItem("xenforo_uuid"), z = i.get("user_id") || localStorage.getItem("uid");
(!I || !z) && rr();
const Y = false;
let g = JSON.parse(i.cache.get("themes") || "null") || {default: {name: "Обычная", source: "data:text/plain,", author: "Lolzteam", palette: ["rgba(52, 52, 52)", "rgb(214,214,214)"]}, next: {name: "Next", source: "https://lztnext.0-day.pw/assets/themes/next.css", author: "кустик, zoto_ff", palette: ["rgba(33, 33, 33)", "rgb(13, 179, 121)"]}};
const {fetch: k} = unsafeWindow, l = {};
l.headers = {};
const N = (rP, rp = l) => {
return new Promise((a1, a2) => {
rp.headers = rp.headers || {};
if (rP.match(u)) {
if (!z) return;
rp.headers["lztnext-payload"] = E, rp.headers.Authorization = rp.headers.Authorization || "Bearer " + I.split("%")[0], rp.headers["lolz-user-id"] = z, rp.headers["lztnext-version"] = GM_info.script.version;
const a5 = Math.floor(Date.now() / 1e3), a6 = a5 + "," + b(L() + ("-" + rp.headers["lztnext-payload"] + "-" + rp.headers.Authorization + "-" + rp.headers["lolz-user-id"] + "-" + rp.headers["lztnext-version"] + "-" + (a5 - a5 % 22)));
rp.headers["lztnext-hash"] = a6;
}
rp.onabort = () => a2(), rp.onerror = () => a2(), rp.ontimeout = () => a2(), rp.onload = a8 => {
a1(a8.response);
}, rp.url = rP, GM_xmlhttpRequest(rp);
});
};
if (Y) unsafeWindow.storage = i;
const u = "https://lztnext.0-day.pw/";
function t(rP = null, rp = false) {
rM(rP), rO(rP);
if (i.get("hide_avatars") === "true") {
document.querySelectorAll(".avatar img, .avatar span.img").forEach(a3 => rJ(a3));
if (rp) {
const a3 = $$(".avatarScaler");
if (a3.length) {
const a4 = a3.find("img"), a5 = $$("#page_info_wrap .username span");
let a6 = a5.attr("data-renamed") || a5.text();
a4.replaceWith(re(a4, a6, true));
}
}
} else document.querySelectorAll(".avatar img").forEach(async a7 => {
var _U$Cv, _c$CS;
const a9 = await rw(a7.src);
if (!a7.ad) a7.src = a9;
}), document.querySelectorAll(".avatar span.img.s").forEach(async a7 => {
const a8 = await rw(a7.style["background-image"].slice(5, -2));
if (!a7.ad) a7.style["background-image"] = "url(" + a8 + ")";
});
const a1 = i.get("redirect");
if (a1 && a1 !== "none") {
const a7 = a1 === "lolz" ? "zelenka.guru/" : "lolz.guru/", a8 = a1 === "zelenka" ? "zelenka.guru/" : "lolz.guru/";
document.querySelectorAll('a[href*="' + a7 + '"]').forEach(async a9 => {
a9.href = a9.href.replace(a7, a8);
}), Array.from($('a:contains("' + a7 + '")')).forEach(async a9 => {
a9.innerHTML = a9.innerHTML.replace(new RegExp(a7.replace(/\//g, "\\/"), "g"), a8);
});
}
}