This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hexdump(src, length=16, sep='.'): | |
FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or sep for x in range(256)]) | |
lines = [] | |
for c in xrange(0, len(src), length): | |
chars = src[c:c+length] | |
hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
if len(hex) > 24: | |
hex = "%s %s" % (hex[:24], hex[24:]) | |
printable = ''.join(["%s" % ((ord(x) <= 127 and FILTER[ord(x)]) or sep) for x in chars]) | |
lines.append("%08x: %-*s |%s|\n" % (c, length*3, hex, printable)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz | |
mkdir -p /usr/local/lib /usr/local/bin | |
sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib | |
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want to return something other than 1/8ths an inch | |
# then change the two 8.0s and the 8 to that sometheing else | |
# or start using millimeters for goodness' sake | |
from math import ceil,modf | |
def mm2inch(millimeters): | |
a = float(millimeters) / 25.4 # mms -> inches | |
b = modf(a)[0] # 0 is the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//while inotifywait -e close_write boiler.pov ; do povray boiler.pov -H1050 -W1680 +A0.1 -o- > /home/user/background.png ; done | |
camera {right 16/9*x look_at <0,-10,0> angle 48 location <1,1,-1>*50 } | |
light_source {<2,1,-0.5>*5000 color rgb 1} | |
light_source {<1,1,1>*5000 color rgb 1} | |
background { rgb <1,1,1>*0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert *.png -background black -gravity center -extent 1280x720 -set filename:f '%t' '%[filename:f].jpg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vapory depends on numpy | |
from vapory import * | |
camera = Camera( 'location', [30,30,-30], 'look_at', [0,0,0] ) | |
light1 = LightSource( [100,100,-200], 'color', [1,1,1] ) | |
light2 = LightSource( [-100,-100,200], 'color', [1,1,1] ) | |
bg = Background('color',[1,1,1]) | |
ll = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
from PIL import Image | |
import psutil | |
filename = './rectangle.png' | |
modifiedTime = os.stat(filename).st_mtime | |
while True: | |
time.sleep(0.1) | |
checkTime = os.stat(filename).st_mtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
fo = open(sys.argv[1] + '.pov') | |
a = fo.read() | |
fo.close() | |
b = a.find('prism') | |
c = a[b:] | |
d = c.find('}') | |
e = c[:d+1] | |
f = e.replace('prism','#declare ' + sys.argv[1] + ' = ' + 'lathe') | |
g = f.replace(' linear_sweep\n','') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import cos,sin,atan,radians | |
import os | |
class Pt(): | |
def __init__(self,x=0,y=0): | |
self.x = x | |
self.y = y | |
def rotate(self,about,a,returnInts=False): | |
ax = about.x |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.