Skip to content

Instantly share code, notes, and snippets.

View tyilo's full-sized avatar
👀

Asger Hautop Drewsen tyilo

👀
View GitHub Profile
// ==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==
qpdf --password=[password] --decrypt [in] [out]
@tyilo
tyilo / DES crypt.js
Created July 9, 2013 01:57
JS DES crypt
/* JavaScript password hash generator.
* $Id: pwd.js,v 1.5 2004/10/09 09:41:38 emikulic Exp $
*
* Copyright (c) 2004, Emil Mikulic.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
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