Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / ec2unifiedshell.py
Created January 20, 2010 01:39
#!/usr/bin/python
WhatThisIS="""
This is a hacked together script to connect to all of your running EC2 instances, and to provide a single SSH prompt amongst all of them, and to assist in uploading, splitting, and downloading files. email me at winniningham at and email server called gmail.com :P
"""
import paramiko
from numpy import *
@xzj
xzj / clojure.ctags
Created December 25, 2011 07:00
my .ctags(exuberant-ctags) for Clojure
--langdef=Clojure
--langmap=Clojure:.clj
--regex-clojure=/\([ \t]*create-ns[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/n,namespace/
--regex-clojure=/\([ \t]*def[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/d,definition/
--regex-clojure=/\([ \t]*defn[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/f,function/
--regex-clojure=/\([ \t]*defn-[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/p,private function/
--regex-clojure=/\([ \t]*defmacro[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/m,macro/
--regex-clojure=/\([ \t]*definline[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/i,inline/
--regex-clojure=/\([ \t]*defmulti[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/a,multimethod definition/
--regex-clojure=/\([ \t]*defmethod[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/b,multimethod instance/
@wesm
wesm / function_lengths.py
Created January 8, 2012 22:34
Count all function lengths under a directory
from pandas import DataFrame
from pandas.util.testing import set_trace
import os
import numpy as np
import matplotlib.pyplot as plt
dirs = []
names = []
lengths = []
@sattvik
sattvik / HelloActivity.clj
Created April 11, 2012 18:57
HelloActivity.clj
(ns com.example.hello_clojure.HelloActivity
(:gen-class :main false
:extends android.app.Activity
:exposes-methods {onCreate superOnCreate})
(:import [com.example.hello_clojure R$layout]))
(defn -onCreate
[this bundle]
(doto this
(.superOnCreate bundle)
@dataolle
dataolle / sendxbmc.sh
Created December 4, 2012 18:50
send url to xbmc's json-rpc service for playback on the big screen
#!/bin/bash
#set url and port to the xbmc box webservice
XBMC_HOST="http://127.0.0.1:8080"
if [ "$1" = "" ]; then
echo -n "Insert URL: "
read url
else
url="$1"
fi
@rogerallen
rogerallen / leip_polyrhythm.clj
Created April 30, 2013 15:57
Fun with Leipzig/Overtone & Polyrhythms
(ns explore-overtone.leip-polyrhythm
(:require [overtone.live :as o]
[leipzig.live :as ll]
[leipzig.melody :as lm]))
(def snare (o/sample (o/freesound-path 26903)))
(def kick (o/sample (o/freesound-path 2086)))
(def close-hihat (o/sample (o/freesound-path 802)))
(def open-hihat (o/sample (o/freesound-path 26657)))
(def clap (o/sample (o/freesound-path 48310)))
@jkottke
jkottke / gist:8739051
Last active May 7, 2020 10:52
A list of design/writing/coding music recommendations from my Twitter followers
Not sure how to summarize/organize this into something useful. Some can be made into Spotify/Rdio playlists, but others are likely unavailable and some are just URLs to other services. Genre is all over the place as well...lots of ambient and classical, soundtracks, uptempo dancey stuff, rock w/ words, and even Slayer. Not sure all that can be put into one playlist that's useful for anyone. What I'm saying is, good luck!
fantoraygun ‏@fantoraygun 1h
@jkottke some great mixes here: http://musicforprogramming.net/
Andrew ‏@jandrewc 1h
@jkottke "From here we go sublime" by The Field and "Alive 2007" by Daft Punk.
Lenny ‏@lenny_ 1h
@jkottke SomaFM's Groove Salad station
@M66B
M66B / gist:62793616a6359886d4c8
Last active April 1, 2017 04:37
Acer C720 fix tearing
sudo nano /usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
Option "TearFree" "true"
EndSection
Settings > Window Manager Tweaks > Enable display compositing
anonymous
anonymous / gist:ca0e6a2ae70b38d2bba4
Created August 4, 2014 11:11
'pulse'
int[][] result;
float t;
void setup() {
setup_();
result = new int[width*height][3];
}
void draw() {
@fivethreeo
fivethreeo / export_bezier_threejs.py
Last active January 15, 2024 04:47
Script to export bezier curves from blender to three.js
import bpy
myCurve = bpy.data.curves[0] # here your curve
spline= myCurve.splines[0] # maybe you need a loop if more than 1 spline
scale = 200
curvepath_template = """
var curves = new THREE.CurvePath();
%s