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
#!/usr/bin/env python | |
import json | |
import requests | |
from settings import host, key | |
data = requests.get('http://%s/api/%s/lights/2' % (host, key)).json() | |
lamp_on = data['state']['on'] | |
print data | |
if not lamp_on: |
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
--- hello.js 2014-01-15 18:42:39.446944705 +0100 | |
+++ hello.js.fix 2014-01-15 18:20:23.099359963 +0100 | |
@@ -1,8 +1,6 @@ | |
(function() { | |
- var http; | |
- | |
- require(http = 'http'); | |
+ var http = require('http'); | |
http.createServer(function(req, res) { |
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
http = require 'http' | |
url = require 'url' | |
http_proxy = require 'http-proxy' | |
proxy = new http_proxy.RoutingProxy() | |
http.createServer (req, res) -> | |
console.log 'Incoming Request from: ' + | |
req.connection.remoteAddress + |
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
$fn=10; | |
minkowski() { | |
difference() { | |
cube(size=[100,13,0.5], center=true); | |
union() { | |
translate(v=[50,10,0]) rotate(a=[0,0,-30]) cube(size=[30,20,4], center=true); | |
translate(v=[50,-10,0]) rotate(a=[0,0,30]) cube(size=[30,20,4], center=true); | |
} | |
} | |
sphere(r=0.5, center=true); |
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
#!/usr/bin/env python | |
import subprocess, time, requests | |
last_line = "" | |
while True: | |
try: | |
lines = subprocess.check_output(["mocp", "-i"]) | |
lines2 = lines.split('\n') | |
artist = "" |
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
#!/usr/bin/env python | |
import time | |
from math import log10 | |
Vin = 5.0 | |
if Vin < 3.8: | |
D = 0.8 | |
else: |
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
module circlet(diameter, thickness, height) { | |
inner = diameter/2; | |
difference() { | |
cylinder(r=inner+thickness, h=height, $fn=256); | |
cylinder(r=inner, h=height*3, center=true, $fn=256); | |
translate(v=[0,20,0]) | |
cube(size=[inner*2-6, inner*2, height*3], center=true); | |
} |
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
#!/usr/bin/env python | |
import subprocess, time, requests, sys | |
last_line = "" | |
while True: | |
try: | |
lines = subprocess.check_output(["mpc", "current", "-f", "%artist%_%album%_%title%"]) | |
artist = "" | |
song = "" |
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
xmodem: exe/$(PROJECTNAME).bin | |
screen -d -m -S 'serial' /dev/ttyACM4 115200 | |
sleep 0.1 | |
screen -x "serial" -X eval '!!!| echo u' | |
sleep 0.1 | |
screen -x "serial" -X eval "exec !! sx -vv $<" | |
sleep 2 | |
screen -x "serial" -X eval '!!!| echo b' |
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
#!/usr/bin/env python | |
# (c) 2015 Productize <joost@productize.be> | |
import sys, copy, collections, codecs | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(open(sys.argv[1])) | |
date = soup.design.date.contents[0] |
OlderNewer