Skip to content

Instantly share code, notes, and snippets.

@joskid
joskid / gist:2054392
Created March 17, 2012 02:15
The Zen of R
# I am a scientist who has been using R for about 2 years. Today I achieved a measure of enlightenment into
# the zen of R, and I want to share it with you.
# I was simulating a set of independent random walks, which are formed by a multiplicative process. Here is
# the code I had built up over a few months of working on it and modifying it on and off as research
# questions changed:
TimeSteps <- 1000
Walks <- 100
ErrorMagnitude <- 0.03
#!/bin/bash
#
# Note: This is the only file you *really* need. I've copied the contents
# of the important files that are part of our git repo for easier reading
# below :)
#
# I've prefixed this file with two dots to make it rise to the top of the
# gist. you can ignore those
#
@joskid
joskid / correlation_examples.R
Created May 19, 2012 00:45 — forked from beaucronin/correlation_examples.R
Examples of dependence beyond correlation
#From http://en.wikipedia.org/wiki/File:Correlation_examples2.svg
#Title: An example of the correlation of x and y for various distributions of (x,y) pairs
#Tags: Mathematics; Statistics; Correlation
#Author: Denis Boigelot
#Packets needed : mvtnorm (rmvnorm), RSVGTipsDevice (devSVGTips)
#How to use: output()
#
#This is an translated version in R of an Matematica 6 code by Imagecreator.
@joskid
joskid / benchmark.txt
Created May 19, 2012 05:23 — forked from thinkjson/benchmark.txt
JSON to CSV conversion benchmarking
json2csv.py
real 5m28.824s
user 5m27.584s
sys 0m1.524s
C (https://github.com/jehiah/json2csv)
real 0m15.945s
user 0m15.181s
sys 0m1.204s
@joskid
joskid / DeliciousScraper.rb
Created May 23, 2012 19:02 — forked from taylorbrooks/DeliciousScraper.rb
Scrape a Delicious Feed and Save the data to a CSV
require 'rubygems'
require 'csv'
require 'json'
require 'net/http'
def scrape(username, tag)
url = "http://www.delicious.com/v2/json/#{username}/#{tag}?count=1000"
resp = Net::HTTP.get_response(URI.parse(url))
data = resp.body
@joskid
joskid / gist:3200529
Created July 29, 2012 17:41 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@joskid
joskid / life.js
Created October 14, 2012 21:26 — forked from simonlc/life.js
HTML5 Conway's Game of Life
// Conway's Game of Life for HTML5 Canvas
// By Simon Laroche
var FPS = 5;
var paused = true;
var gLoop;
var generations = 0;
var population = 0;
var start = document.getElementById('start');
@joskid
joskid / gist:3950435
Created October 25, 2012 04:37 — forked from radiosilence/gist:3946121
Outputs some files that WMs can import and colourify everything with.
import sys
import colorsys
from colorz import colorz
WALLPAPER = '/home/james/.wallpaper'
COLORS = '/home/james/.colors'
XRESOURCES = '/home/james/.Xresources'
cols = ''
xres = """
@joskid
joskid / __readme.md
Created November 23, 2012 16:49 — forked from jimeh/__readme.md
Let's not localize programming languages. Please >_<

Let's not localize programming languages. Please >_<

Feel free to fork and expand and/or add more languages as an example to why this would be horrible, and I'll add them here :)

@joskid
joskid / .bashrc
Created March 11, 2016 14:55 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace