Skip to content

Instantly share code, notes, and snippets.

@kelsey-sorrels
kelsey-sorrels / markov.clj
Created September 6, 2012 04:46
Overtone Internal Sequencer with Markov chains
(ns overtone.examples.internal-sequencer
(:use [overtone.live]))
;; A fully server-side sample sequencer.
;; =====================================
;; This example demonstrates some of the benefits of moving all synth
;; triggers inside the server itself. For example, it allows you to
;; modify the synthesis with *immediate* effect (rather than waiting for
;; the next bar/chunk to be scheduled) and you can use a global pulse to
@jaredwoodard
jaredwoodard / CBOE_csv_to_xts
Created October 19, 2012 01:57
pulls csv files from the CBOE and converts them to xts
library("quantmod")
# we're pulling the Google VIX index (VXGOG) but this also works for VXAPL, VXGS etc.
# see http://www.cboe.com/micro/equityvix/introduction.aspx
url <- "http://www.cboe.com/publish/ScheduledTask/mktdata/datahouse/VXGOGDailyPrices.csv"
symb = read.csv(url,header=FALSE, stringsAsFactors=F)
symb <- symb[-1,]
colnames(symb) <- c(symb[1,])
symb <- symb[-1,]
@chiral
chiral / monad.R
Created December 9, 2012 13:44
Monads on R
"%<-%" <- function(x,y) call("<-",substitute(x),substitute(y))
returm <- function(x) call("return",substitute(x))
exec <- quote
join <- function(ss,sep) {
res <- ""
for (s in ss) {
res <- paste(res,s,sep=sep)
}
res
@gka
gka / lab-colors.R
Created January 24, 2013 13:11
Playing around with CIE Lab colors in R
#
# Playing around with CIE Lab colors in R
#
# load library that provides colorRampPalette
library(grDevices)
# define function for plotting colors
plotColors = function(palette, n=10) {
colors = palette(n)
@celoyd
celoyd / t.py
Last active October 2, 2018 23:36
A simple, mostly-not-mine Twitter stream consumer and s3 bucketer
#!/usr/bin/env python
'''
This code is adapted from the consensus best practice python Twitter feed
consumer that's been floating around for a while now on StackOverflow etc.
My only addition to speak of is TenminWriter. (A "tenmin" is ten minutes
worth of stream. It's just a convenient chunk; you might want to make it
shorter or longer.)
THERE ARE BUGS HERE. THIS IS BARELY TESTED. DO NOT TRUST IT.
@FiloSottile
FiloSottile / 32.asm
Last active June 27, 2026 14:23
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@XVilka
XVilka / TrueColour.md
Last active July 13, 2026 20:43
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@i2pi
i2pi / love_simple.R
Last active June 22, 2021 06:27
Love Simple

love

@timelyportfolio
timelyportfolio / Readme.md
Last active April 26, 2016 13:37
sp vix vs sp500 scatter with rCharts
library(quantmod)
getSymbols( c("LNU00000012", "LNS12000091"), src="FRED" )
plot(diff(LNU00000012, lag=12*5)*1.93+ 385.70445)
lines(lag(diff(LNS12000091, lag=12*5), k=-12*20), col="blue", lty=4)
points(last(na.omit(lag(diff(LNS12000091, lag=12*5), k=-12*20))), pch=16, col="blue")
legend("topright", c("5y Demographic projection of Growth of 35-44 employees", "5y Actual Growth of 35-44 employees"), col=c("black", "blue"), lty=c(1, 4), cex=.6)