Skip to content

Instantly share code, notes, and snippets.

phil jones interstar

View GitHub Profile
@interstar
interstar / trap3.rb
Created Aug 27, 2018
Trap beat for sonic pi
View trap3.rb
use_bpm 145
# Our chord sequence
p1 = [chord(:E3,"minor7"),
chord(:G3,"major7"),
chord(:A3,"minor7"),
chord(:G3,"m9"),
chord(:E3,"m9"),
chord(:C3,"minor7"),
@interstar
interstar / gist:fbfd0391e9d33f5a2fb7334398f60ee8
Created Jul 30, 2017
Versao services.clj no exemplo de grupo FP de Calango
View gist:fbfd0391e9d33f5a2fb7334398f60ee8
(ns clojure-web-server.routes.services
(:require [ring.util.http-response :refer :all]
[compojure.api.sweet :refer :all]
[schema.core :as s])
)
(defonce ideias (atom {:id 0 :nome "root" :criancas
[{:id 1 :nome "hello" :criancas {}}]}))
(defn buscar [id ids]
@interstar
interstar / .block
Created Mar 11, 2017
Directed Graph Editor
View .block
license: mit
View gist:33098d0fa9cb843cd9b5300fe9bb9655
# Five Minutes
# requires Phil's Sonic Pi Lib ( https://github.com/interstar/Phil-s-Sonic-Pi-Lib )
section = :a
live_loop :clock do
section=wait_then(1,:b)
puts section
@interstar
interstar / Sonic Pi sketch
Created Apr 16, 2016
Started as a quick play with Sonic Pi to see if I could create functions that process and transform sequences of notes. Grew into a tune.
View Sonic Pi sketch
define :trans do |xs, d|
return xs.collect { |x| (x+d) }
end
ritmo = [0.2,0.4,0.2,0.4]
i = [:c3,:eb3,:g3,:c4,:c3,:eb3,:g3,:c4]
iv = (trans i, 5)
v = (trans i, 7)
View graphite.pde
#include <Bounce.h>
int anaPin = 5; // Analogue in pin
int button = 2; // button pin
int beepPin = 3; // piezo buzzer
// edges of our calibration window
float aMax;
float aMin;
@interstar
interstar / gist:6051618
Last active Dec 20, 2015
Quora Scraper: And here's a quick page which takes the files containing my answers that I pulled via RSS and makes an HTML page out of them.
View gist:6051618
from os import listdir
from os.path import isfile, join
onlyfiles = [ f for f in listdir(".") if isfile(join("",f)) ]
import json
print """
<html>
<style>
body {
View quorascraper.py
import feedparser
import hashlib
import json
from bs4 import BeautifulSoup
d = feedparser.parse("http://www.quora.com/YOUR-QUORA-NAME/answers/rss")
for e in d["entries"] :
title = e["title"]
summary = e["summary"]
@interstar
interstar / cmdncurse.py
Created Jun 27, 2012
Using Python Cmd and Curses Together
View cmdncurse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import curses
import curses.textpad
import cmd
def maketextbox(h,w,y,x,value="",deco=None,textColorpair=0,decoColorpair=0):
# thanks to http://stackoverflow.com/a/5326195/8482 for this
nw = curses.newwin(h,w,y,x)
@interstar
interstar / permgen.py
Created Feb 25, 2012
Python Permutation Generator : A generator that outputs all permutations of a sequence
View permgen.py
def perm(xs) :
if xs == [] :
yield []
for x in xs :
ys = [y for y in xs if not y==x]
for p in perm(ys) :
yield ([x] + p)
You can’t perform that action at this time.