Skip to content

Instantly share code, notes, and snippets.

@amorri40
amorri40 / Interpreter101_simple.cpp
Created March 20, 2012 19:18
Interpreter101_simple
/*
Google I/O 2008 - Dalvik Virtual Machine Internals
Interpreters 101, toy interpreter
This is a simple toy bytecode interpreter
*/
#include <cstdio>
static void interpreter(const char* stringOfBytecode);
@amorri40
amorri40 / Interpreters101_Thegccway.cpp
Created March 20, 2012 21:52
Interpreters101_Thegccway
/*
The gcc way
*/
#define DISPATCH() \
{ goto *op_table[*((stringOfBytecode)++) - 'a']; }
static void interpreter_the_gcc_way(const char* stringOfBytecode) {
static void* op_table[] = {
&&op_a, &&op_b, &&op_c, &&op_d, &&op_e
};
@amorri40
amorri40 / fixobjc.idc
Created April 2, 2012 06:25
Fix objC for Ida 6.1
// vim: ft=cpp sw=4 ts=4 et
/* (C) 2003-2008 Willem Jan Hengeveld <itsme@xs4all.nl>
*
* Web: http://www.xs4all.nl/~itsme/projects/ida/
*/
#define UNLOADED_FILE 1
#include <idc.idc>
// this script processes the objective C typeinfo tables,
// and names functions accordingly.
@amorri40
amorri40 / packages.txt
Created April 8, 2012 10:27
Enigma Packages
#Category:main - the main binary packages needed to run enigma
lgm 3b76ba33dd2d3a321bdd6a501c4137dd lgm16b4.jar http://dl.dropbox.com/u/9975312/enigma-dep/lgm16b4.jar none
main b5f6de84285a0795ad74f03c32bccafd plugins/enigma.jar http://dl.dropbox.com/u/9975312/enigma-dep/enigma.jar jnaJar,lgm
jnaJar d3ba41fcad5df53da1fe12fc772bb8b6 plugins/shared/jna.jar http://dl.dropbox.com/u/9975312/enigma-dep/jna.jar none
#Category:examples
hit_the_ball bbc69c20a4e5d71025e96148b8c83c89 examples/hit_the_ball.gmk http://dl.dropbox.com/u/5072558/EnigmaUpdater/hit_the_ball.gmk none
#Category:sdks
androidSDK-darwin 387fed6cbdbd89958778c0395be7ce27 SDKs/androidSDK-darwin.epackage http://dl.dropbox.com/u/5072558/EnigmaUpdater/android-ndk-r7b.epackage none
@amorri40
amorri40 / byteToHex.js
Created August 22, 2012 23:04
Javascript Byte to hex
var hexChar = ["0", "1", "2", "3", "4", "5", "6", "7","8", "9", "A", "B", "C", "D", "E", "F"];
function byteToHex(b) {
return hexChar[(b >> 4) & 0x0f] + hexChar[b & 0x0f];
}
/**
* Inserts a warning box under the current cursor location
*/
function insertWarningTableAtCursor() {
if (!doesTheUserWantToContinue('This will insert a warning Box at your current cursor location, are you sure you want to do this?')) return;
var cursor = DocumentApp.getActiveDocument().getCursor();
if (!cursor) {showCursorError(); return;}
@amorri40
amorri40 / useful.js
Last active August 29, 2015 14:07
useful Javascript
/*
Angular
*/
//http://stackoverflow.com/questions/13681116/angularjs-dynamic-routing
@amorri40
amorri40 / Does Cython allow you to write iOS applications that compile natively?
Created November 23, 2014 08:44
Does Cython allow you to write iOS applications that compile natively?
Seems to be possible in a project called Kivy:
http://kivy.org/docs/guide/packaging-ios.html
Kivy seems pretty interesting:
Kivy - Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
But not sure how much it forces the user to code in thier own style..
@amorri40
amorri40 / gist:072e520dafea4477cf83
Created November 23, 2014 08:50
How can I create a website based on github gists?
http://gist.io seemed like a good solution but it doesn't seem to work anymore.
@amorri40
amorri40 / Gruntfile.js
Created March 2, 2015 12:20
Prettify Javascript and HTML on every save with Grunt!
//
// # Prettify Javascript files
//
"jsbeautifier": {
files: ["<%= config.app %>/js/*{,*/}*.js", './dashboards/**/*.js', './app/**/*.js', './bin/**/*.js'],
options: {}
},
//
// # Prettify HTML files