Skip to content

Instantly share code, notes, and snippets.

View skyl's full-sized avatar

Skylar Saveland skyl

View GitHub Profile
@skyl
skyl / defaultdikt.py
Created April 27, 2012 13:29
defaultdict musical score scratchpad idea
"""
1 2 3 4
tekaTa Ta Ka tktkTA
16 16 8 4 4 32 32 32 32 8
0 6 12 24 48 72 75 78 81 84
"""
@skyl
skyl / ta.py
Created April 30, 2012 02:34
Simple Timing arp idea
from itertools import cycle
from bl.arp import RandomArp, OrderedArp, ArpSwitcher
from bl.orchestra.midi import Player, ChordPlayer
from bl.utils import getClock
from tutor.complib import piano_f
piano = piano_f()
@skyl
skyl / gist:4679760
Last active December 11, 2015 23:49
PyCon Registration Bug
Steps
(Chrome)
#. Login (via google)
#. Go to register
#. Do not select the conference registration radio (corporate/hobbyist/etc) and only buy 1 t-shirt
#. Pay for the t-shirt
#. Land on summary page and it says you are not registered for conference (register here button)
#. Click "register" button.
@skyl
skyl / command line
Last active December 25, 2015 20:09
include+when bug in ansible?
% ansible-playbook pb.yml -i h -e "BOOL=that"
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [wtf] *******************************************************************
ok: [localhost] => {
"msg": "that"
@skyl
skyl / gist:7922746
Last active December 31, 2015 02:48
billiard upgrade to 3.3.0.12.tar.gz on OSX
> python
Python 2.7.3 (default, Dec 4 2013, 11:24:08)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import billiard
>>> billiard.VERSION
(2, 7, 3, 31)
>>> ^D
> pip install -U billiard
@skyl
skyl / gist:7922856
Created December 12, 2013 03:40
How to debug? ctypes.CDLL('libSystem.dylib')
>>> import ctypes
>>> ctypes.CDLL('libSystem.dylib')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libSystem.dylib, 6): image not found
@transaction.commit_on_success
def _action(action, o):
getattr(o,action)()
o.is_processing = False
o.save()
def _bulk_action(action, objs):
for o in objs:
_action(action,o)
@skyl
skyl / unfollow.py
Created October 3, 2014 18:30
Selectively unfollow people who don't follow you on twitter with gruesome and gory confirmation
import time
import sys
import tweepy
consumer_key = ""
consumer_secret = ""
key = ""
secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@skyl
skyl / gist:1359979
Created November 12, 2011 03:15
multidimensional k-means cluster finder in python
import math
import random
class ClusterCenters(object):
"""
>> d = ((0,0,0), (0,1,0), (0, 2, 0), (1,2,0), (55, 55,50), (50,50,50), (-100,-100,-100), (-80,-80,-100), (60,60,50))
>> cc = ClusterCenters(d, 3)
[[55, 55, 50], [0, 1, 0], [-90, -90, -100]]
>> cc = ClusterCenters(d, 2)
@skyl
skyl / timing_beat.py
Created May 6, 2012 23:50
bl timingarp branch review
import random
import operator
from itertools import permutations
from bl.scheduler import clock, Tempo # , Meter
from bl.arp import RandomArp, OrderedArp, ScheduleArp # , ArpSwitcher
from bl.orchestra.midi import Player
from tutor.complib import drums_f