Skip to content

Instantly share code, notes, and snippets.

View zrnsm's full-sized avatar

Nicolas Steven Miller zrnsm

View GitHub Profile
@zrnsm
zrnsm / hello_rogue.py
Created May 22, 2018 03:27
Hello Rogue World
import curses
def main(w):
curses.use_default_colors()
window_height, window_width = w.getmaxyx()
player_y = window_height / 2
player_x = window_width / 2
def redraw_player():
w.delch()
w.move(player_y, player_x)
@zrnsm
zrnsm / build_vcv_plugins.py
Created February 3, 2018 05:18
Fetch and build all available VCV Rack source plugins
import os
import json
os.system('git clone https://github.com/VCVRack/community.git')
plugin_dir = os.path.join(os.getcwd(), 'community', 'plugins')
for plugin_slug_file in os.listdir(plugin_dir):
with open(os.path.join(plugin_dir, plugin_slug_file)) as f:
source_url = json.load(f).get('source')
if source_url:
source_url = source_url.rstrip('/')
if source_url.endswith('.git'):
@zrnsm
zrnsm / gist:3c00ce870128e4176ce3
Last active August 29, 2015 14:15
Spiral Golf
n,r,c=31,range,'x '
s=map(r,[n]*n)
def f(x):
q=r(x,n-x)
for i in q:
for j in q:s[i][j]=c[x%2]
for i in r(0,n/2,2):f(i),f(i+1);s[i+2][i+1],s[i+1][i]=c
for r in s:print ' '.join(r)