Skip to content

Instantly share code, notes, and snippets.

@smitec
smitec / fractal_mountains.py
Created January 13, 2014 20:15
Generate tile-able (in 1 direction) mountains. Useful for game backgrounds.
import random
import Image
def fractal_mountain(pixels, damping, seed=0.0):
px = [seed, seed]
factor = 1.0;
while(len(px) < pixels):
# loop through and generate
new_p = []
for i in range(1, len(px)):
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/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
#
@mvanveen
mvanveen / get_bottle.py
Created January 31, 2012 20:22
Download latest bottle build to your specified directory
#!/usr/bin/env python
"""Downloads the most recent bottle build from gitub in a specified directory
"""
import os
import sys
import urllib2
bottle_url = 'https://github.com/defnull/bottle/raw/master/bottle.py'
@sontek
sontek / snowjob.sh
Last active August 9, 2024 13:14
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
@mvanveen
mvanveen / enlightenment.py
Created November 16, 2011 06:47
eval() thyself and recurse anew
eval("""
eval(__import__('inspect').getsource(
__import__(
__import__('os').path.relpath(
__import__('os').path.splitext(__file__)[0]
))))
""")