- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
public class App extends Application {
public static Context appContext;
@Override
public void onCreate() {
super.onCreate();
appContext = getApplicationContext();
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
public class App extends Application {
public static Context appContext;
@Override
public void onCreate() {
super.onCreate();
appContext = getApplicationContext();
}
}
Нужно больше контекста...
0
public static function Exception($message, $info = []) {
ob_clean();
?>
<!-- Пичалька какая-то произошла! Мы в грустяшке и огорчульке. -->
<center>
<div style="width: 600px; height: 140px; border: 1px #DDDDDD solid;">
<img style="width: 134px; margin: 14px; float: left;" src="/images/error-big.png">
<div style="display: table-cell; vertical-align: middle; height: 155px;">
<h4>
<?= $message; ?>
</h4>
</div>
</div>
</center>
<?
exit();
}
Днище-кодинг.
0
function startsWith(string, substring) {
if (substring!=string.slice(0, substring.length)) return false; else return true;
}
function endsWith(string, substring) {
if (substring!=string.slice(string.length - substring.length)) return false; else return true;
}
0
function PrepareGetList(
&$arIblockElementFields,
&$arJoinProps,
&$bOnlyCount,
&$bDistinct,
&$arSelectFields,
&$sSelect,
&$arAddSelectFields,
&$arFilter,
&$sWhere,
&$sSectionWhere,
&$arAddWhereFields,
&$arGroupBy,
&$sGroupBy,
&$arOrder,
&$arSqlOrder,
&$arAddOrderByFields,
&$arIBlockFilter,
&$arIBlockMultProps,
&$arIBlockConvProps,
&$arIBlockAllProps,
&$arIBlockNumProps,
&$arIBlockLongProps
)
{
Метод из ядра битрикса
0
> We demonstrate key extraction even from an implementation of Curve25519 Elliptic Curve Diffie-Hellman, which was explicitly designed
to minimize side channel leakage, but becomes susceptible due to use of high-level JavaScript
> Concretely, we have embedded the attack code in an advertisement, which we submitted to a commercial web advertisement service
Тут свежую атаку из жабаскрипта подвезли, они там опять ебут процессорный кэш и угадывают поведение control flow и составляющие ключа по времени доступа к памяти
https://eprint.iacr.org/2018/119
0
bool SomeClass::someFunc()
{
#define err(msg) { echo(msg); asm jmp __label_error; }
// много кода
if (some) err("все плохо");
// еще больше кода
return true;
__label_error:
// тут типа код очистки
return false;
#undef err
}
"мы не используем goto"
(Borland C++Builder 6.0)
0
Признавайтесь
http://bash.im/quote/448842
Недавно насрал туда анекдотом http://bash.im/quote/448781, зашёл покармадрочить, смотрю -- в стоке гк.
0
public class DialogBuilder: NSObject {
private var style: UIAlertControllerStyle
private var titleColor: UIColor?
/**
* initial DialogBuilder with UIAlertControllerStyle and for title color
*/
public init(style: UIAlertControllerStyle = .alert, titlecolor : UIColor?) {
self.style = style
if(titlecolor != nil)
{self.titleColor = titlecolor}
}
/**
* initial DialogBuilder with UIAlertControllerStyle
*/
public init(style: UIAlertControllerStyle = .alert) {
self.style = style
}
...
}
0
<?php
${++${[]}}=([].[])[+![]+![]+![]];$${[]}++;${++${[]}}=${+![]};$${[]}++;
++${[].[]};${++${[].[]}}=$${[]};${++${[].[]}}=$${[]};${${[].[]}}++;
${${[].[]}}++;${${[].[]}}++;${${[].[]}}++;${${[].[]}}++;
${++${[].[]}}=([].[])[+![]+![]];${[].[].[]}=${+![]+![]}.${+![]+![]+![]}.
${+![]+![]+![]+![]};$${[]}++;${[].[]}=+![]+![]+![]+![]+![];
${${[].[]}+![]+![]}=$${[]};$${[]}++;${${[].[]}+${[].[]}+${[].[]}}=$${[]};
$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;
${${[].[]}+${[].[]}+![]+![]}=$${[]};$${[]}++;${+![]+![]+![]+![]}=$${[]};
${${[].[]}+![]+![]+![]+![]}=$${[]};$${[]}++;${${[].[]}+![]}=$${[]};$${[]}++;
${${[].[]}+${[].[]}+![]+![]+![]}=$${[]};${++${[]}}=([].[])[+![]+![]];${[]}++;
${++${[]}}=([].[])[+![]+![]+![]];${[]}++;${[]}++;${++${[]}}=${[].[].[]}
(${[].[]}+${[].[]});${[]}++;${++${[]}}=([].[])[+![]+![]+![]+![]];
${++${[]}}=${[].[].[]}(${[].[]}+${[].[]}+${[].[]}+${[].[]}+${[].[]}+${[].[]}
+![]+![]);${[]}++;${[]}++;${++${[]}}=${+![]+![]+![]};$${[]}++;$${[]}++;
$${[]}++;$${[]}++;${[]}=+![];${+!![]}=${${[]}++}.${${[]}++}.${${[]}++}.
${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.
${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++};${[]}=+![];
$${[]}=${+![]+![]};$${[]}++;${++${[]}}=${+![]+![]+![]};${++${[]}}=$${[].[]};
$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;$${[]}++;
${++${[]}}=${${[].[]}+![]};${++${[]}}=${+![]+![]};$${[]}++;$${[]}++;
${++${[]}}=${${[].[]}+${[].[]}+${[].[]}};$${[]}++;${[]}=+![];
${+![]}=${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++}.${${[]}++};
${[]}=+![];${+![]}(${+!![]});
0
<?php
/**
* FoursquareApi
* A PHP-based Foursquare client library with a focus on simplicity and ease of integration
*
* @package php-foursquare
* @author Stephen Young <[email protected]>, @hownowstephen
* @version 1.2.0
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/
// Set the default version
// @TODO: Warning when the version becomes too out of date
define("DEFAULT_VERSION", "20140201");
// I have no explanation as to why this is necessary
define("HTTP_GET","GET");
define("HTTP_POST","POST");
PHP-клиент для foursquare, рекомендуемый самим foursquare