Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tyilo's full-sized avatar
👀

Asger Hautop Drewsen tyilo

👀
View GitHub Profile

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
@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 = []
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);
// ==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==
@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
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 / ls.cpp
Last active September 29, 2017 00:22
#include <bits/stdc++.h>
#include <regex.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto & a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto & a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Snapsedaterne built the Schnapps Counter app as an Open Source app. This SERVICE is provided by Snapsedaterne at no cost and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding our policies with the collection, use, and
disclosure of Personal Information if anyone decided to use our Service.
</p> <p>If you choose to use our Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that we collect is used for providing and improving the
Service. We will not use or share your information with anyone except as described
in this Privacy P