Skip to content

Instantly share code, notes, and snippets.

View muriloadriano's full-sized avatar

Murilo Adriano Vasconcelos muriloadriano

View GitHub Profile
@muriloadriano
muriloadriano / php_hash_output.txt
Created October 16, 2013 19:17
PHP keys that collide to the same key on PHP
This file has been truncated, but you can view the full file.
14307
30345
185278
191839
257449
273487
339097
345658
361696
417829
Process: dota_osx [1093]
Path: /Users/USER/Library/Application Support/Steam/*/dota_osx
Identifier: dota_osx
Version: ???
Code Type: X86 (Native)
Parent Process: bash [1090]
User ID: 501
Date/Time: 2013-07-22 18:23:07.078 -0300
OS Version: Mac OS X 10.8.4 (12E55)
// Algumas vezes precisamos criar uma classe que utilizaremos apenas
// uma vez (um objeto) e nunca mais, poluindo o espaco de nomes
// e dando mais trabalho
class MyClickable implements Clickable {
function onClick() {
showOnScreen();
}
}
function printElements(x) {
for (var i = 0; i < x.size(); ++i) { // if string has no size() it can't be used in this function
println(x.at(i));
}
}
@muriloadriano
muriloadriano / gist:1120161
Created August 2, 2011 13:19
CodeGen Visitor for FOR expressions
/**
* Generates the opcode for FOR expression
*/
AST_VISITOR(CodeGenVisitor, ForExpr) {
Value* value;
Opcode* jmpz;
Opcode* jmp;
unsigned int start_pos = 0;
if (!expr->isIteratorMode()) {
In file included from /usr/include/machine/_types.h:34,
from /usr/include/sys/_types.h:33,
from /usr/include/_types.h:27,
from /usr/include/unistd.h:71,
from /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/os_defines.h:61,
from /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++config.h:41,
from /usr/include/c++/4.2.1/utility:65,
from /usr/include/c++/4.2.1/tr1/hashtable:55,
from /usr/include/c++/4.2.1/tr1/unordered_map:37,
from ./compiler/ssa.h:29,
CLEVER_VM_HANDLER(VM::obj_constr_handler) {
CallableValue* var = static_cast<CallableValue*>(opcode.get_op1());
Value* args = opcode.get_op2();
Value* result = opcode.get_result();
const ValueVector* func_args = args ? args->getVector() : NULL;
result->initialize();
/* Call the method */
var->call(result, func_args);