Skip to content

Instantly share code, notes, and snippets.

View tyilo's full-sized avatar
👀

Asger Hautop Drewsen tyilo

👀
View GitHub Profile
default partial alphanumeric_keys
xkb_symbols "basic" {
include "us(basic)"
name[Group1]= "English (US, with æøå)";
key <AD11> { [ bracketleft, braceleft, aring, Aring ] };
key <AC10> { [ semicolon, colon, ae, AE ] };
key <AC11> { [ apostrophe, quotedbl, oslash, Ooblique ] };
@tyilo
tyilo / gist:328cff50b7632c76b50f
Last active February 7, 2017 07:28
Cycript wishlist
  • autocomplete for native functions:
    • a = new Pointer(0x1337, @encode(void)); a.<tab>
  • system.print that prints to cycript console when injected into a process
// ==UserScript==
// @id chrome-image-form-crash@tyilo.com
// @name Chrome Crash Test: Insert form on image and submit
// @version 1.0
// @namespace http://tyilo.com/
// @author Asger Drewsen <asgerdrewsen@gmail.com>
// @description ...
// @include http://www.w3.org/Graphics/PNG/alphatest.png
// @run-at document-end
// ==/UserScript==
int main(void) {
// Signature of setState
void (*setState)(BOOL);
void *handle = dlopen("/path/to/lib.dylib", RTLD_LAZY);
*(void **) (&setState) = dlsym(handle, "setState");
// To enable
setState(YES);
@tyilo
tyilo / min-coin-bruteforce.py
Last active December 16, 2015 13:48
The minimum coin problem solution in python
coins_values = [2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01]
coins_amount = [1, 2, 2, 3, 1, 2, 2, 2 ]
price = 1.7
import itertools
total_coins = 0
coins_list = []

This doesn't work with OS X 10.9 or later. If you want to build gdb-ng either use Mountain Lion or ask gdbinit (github)/osxreverser (twitter)/fractalg (irc) to fix it for you ;^)

Install darwinbuild:

sudo port install darwinbuild

Download and pack gdb-ng:

cd /tmp
wget --no-check-certificate https://github.com/gdbinit/gdb-ng/archive/master.zip