Skip to content

Instantly share code, notes, and snippets.

View mccolgst's full-sized avatar

Sean mccolgst

View GitHub Profile
function rule30(in_array)
out_array = {}
for i=-128,128 do
cel = false
l=in_array[i]
m=in_array[i+1]
r=in_array[i+2]
if (l and not m and not r)
or (not l and m and r)
or (not l and m and not r)
@mccolgst
mccolgst / pretty_print.lua
Last active November 28, 2017 02:32
pretty print in lua
print_time=0
function pretty_print(str, x, y)
print_time+=0.1
if print_time==60 then print_time=0 end
local ymod = (print_time%60)/10
printh(sin(ymod))
for i=-1,1 do
for j=-1,1 do
print(str, x+i, y+j+sin(ymod)*4, 1)
end
@mccolgst
mccolgst / semicircles.p8
Last active September 13, 2017 01:53
draw semicircles pico8
semicircs = {}
function _init()
for i=0,20 do
create_semicirc(rnd(128), rnd(128),
rnd(1), rnd(1)+rnd(1),
rnd(30), flr(rnd(14)))
end
end
function _update()
### Keybase proof
I hereby claim:
* I am mccolgst on github.
* I am mccolgst (https://keybase.io/mccolgst) on keybase.
* I have a public key whose fingerprint is 30A1 84C8 56B0 CEA5 51AF D6F5 9B23 04D9 1F52 20B7
To claim this, I am signing this object:
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
</head>
<!-- You need to have a copy of jquery-1.4.2.min.js in the same dir as this gist for it to work -->
<body>
<a href="#" id="twit">get tweets</a>
<ul id="tweets"></ul>
<script type="text/javascript">
$('#twit').click(function(){
import subprocess
import urllib2
from xml.dom import minidom
xml = minidom.parse(urllib2.urlopen('http://8bitcollective.com/rss/music'))
for it in xml.getElementsByTagName("enclosure"):
subprocess.Popen(['wget', it.getAttribute('url')])