This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request = { | |
Dispatch: function(params, callback) { | |
setTimeout(function() { | |
callback() | |
}, params.waitSeconds || 0); | |
} | |
}; | |
function sendRequest(waitSeconds) { | |
var timestamp = (new Date()).getTime(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mysql = require('mysql'); | |
var mysqlConfig = { | |
connectionLimit : 100, | |
host : 'hostname', | |
user : 'username', | |
password : 'password', | |
database : 'database', | |
acquireTimeout : 30000 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
int main() { | |
system("cat text.txt | grep -Po 'answer=\"\\K[^\"]*'"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# names of latest versions of each package | |
export VERSION_PCRE=pcre-8.38 | |
export VERSION_OPENSSL=openssl-1.0.2d | |
export VERSION_NGINX=nginx-1.9.7 | |
# URLs to the source directories | |
export SOURCE_OPENSSL=https://www.openssl.org/source/ | |
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /test { | |
content_by_lua_block { | |
local arg = ngx.var.arg_upload | |
local method = ngx.req.get_method() | |
if method == "POST" then | |
if arg then | |
ngx.exec("@flash") | |
else | |
ngx.exec("@post") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.test; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
class Base { | |
void testReflection() { | |
try { | |
Method method = this.getClass().getDeclaredMethod("subMethod", Integer.TYPE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class K { | |
private int c; | |
public int getC() { | |
return c; | |
} | |
public void setC(int c) { | |
this.c = c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b64Str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
var b64Table = {}; | |
var b64Chars = []; | |
var b64LookupTable = []; | |
for (var i = 0; i < b64Str.length; i++) { | |
var ch = b64Str.charCodeAt(i); | |
b64Table[ch] = i; | |
b64Chars[i] = ch; | |
b64LookupTable[ch] = i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ieee754_read(buffer, offset, isLE, mLen, nBytes) { | |
var e, m; | |
var eLen = (nBytes * 8) - mLen - 1; | |
var eMax = (1 << eLen) - 1; | |
var eBias = eMax >> 1; | |
var nBits = -7; | |
var i = isLE ? (nBytes - 1) : 0; | |
var d = isLE ? -1 : 1; | |
var s = buffer[offset + i]; |
OlderNewer