Skip to content

Instantly share code, notes, and snippets.

@alanyjw
alanyjw / uncheck.js
Created May 11, 2020 13:04
Uncheck all choices in Spaces for Paperform's Add User page
(function() {
'use strict';
Array.from(document.getElementsByClassName('Choices__choice'))
.map(e => e.click() );
})();
# Word and Character Count service for Mac OS X
#
# Adds a Word and Character Count option to the text selection context menu in all apps
#
# Use Automator.app to create a new service, and then select the Run AppleScript action.
# Paste this code in to the text box, and save as Word and Character Count. Now switch to
# a new app, select some text, and open the context menu to find the new option.
on run {input, parameters}
tell application "System Events"
@alanyjw
alanyjw / Fibonacci.c
Created October 17, 2012 21:02
Continuation passing style for Fibonacci in Java (translated from C)
// Original
int mystery(int n) {
int aux (int n, int (*k)(int)) {
int k1 (int ret) {
int k2 (int ret2) {
return k(ret+ret2);
}
return aux(n-2, k2);
}
@alanyjw
alanyjw / install_pytho27.sh
Created April 11, 2012 11:25 — forked from ftao/install_pytho27.sh
install python 2.7 on debian 6
#!/bin/sh
mkdir ~/down/
cd ~/down/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
@alanyjw
alanyjw / hack.sh
Created April 1, 2012 02:47 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#