Skip to content

Instantly share code, notes, and snippets.

View andreicek's full-sized avatar
☘️

Andrei Zvonimir Crnković andreicek

☘️
View GitHub Profile
@dionyziz
dionyziz / peano.js
Created August 28, 2011 16:05
Javascript Peano Arithmetic from thin air
// peano.js - Javascript Peano Arithmetic from thin air
// Developer: Dionysis "dionyziz" Zindros <[email protected]>
//
// This is an illustration of how it is possible to construct the system of arithmetic
// on non-negative integers in Javascript without requiring any underlying arithmetic code by the host language.
// The system is based purely on the underlying logic of the language; that is, "if", "and", "or",
// "not" and the equals operator "==", as well as the logical constants true and false;
// those logical constants, incidentally, can be obtained by issuing "null == null" and "!( null == null)"
// respectively, so they are not required to be defined. Indeed, observe the following alternative:
//
@koma5
koma5 / prowl.sh
Created April 9, 2011 13:09
send prowl push notifications to your iOS device; requires curl -> for debian based distros # apt-get update && apt-get install curl -y
#! /bin/sh
# Usage: ./prowl.sh priority(-2 to 2) app event description
# Example: ./prowl.sh 0 "transmission" "torrent has finished" "Coen Brothers Compilation has finised downloading"
priority=$1
app=$2
event=$3
description=$4
apikey=fill_in_your_API_key_here
if [ $# -ne 4 ]; then
@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@defunkt
defunkt / browser
Created March 1, 2010 10:01
pipe html to a browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
if [ -n "$1" ]; then