Skip to content

Instantly share code, notes, and snippets.

@philippbosch
philippbosch / index.html
Created April 12, 2013 09:05
WebSockets example
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>WebSocket Test</title>
</head>
<body>
<script>
var ws = new WebSocket('ws://172.18.246.234:8080/p5websocket');
ws.onopen = function() {
@philippbosch
philippbosch / index.html
Created April 12, 2013 10:24
Firebase example
<div id="currentNumber"> </div>
<button id="increment">+</button>
<button id="reset">Reset</button>
<script src="https://cdn.firebase.com/v0/firebase.js"></script>
<script>
var currentNumber = document.getElementById('currentNumber');
var incrementButton = document.getElementById('increment');
var resetButton = document.getElementById('reset');
@philippbosch
philippbosch / sprintf.ino
Created April 16, 2013 12:59
sprintf() in Arduino code
unsigned int i = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
char buffer[50];
sprintf(buffer, "the current value is %d", i++);
Serial.println(buffer);

Keybase proof

I hereby claim:

  • I am philippbosch on github.
  • I am philippbosch (https://keybase.io/philippbosch) on keybase.
  • I have a public key whose fingerprint is 0767 102D 8645 0F7D EA0B D4FA C8DB A35E 90B0 0103

To claim this, I am signing this object:

@philippbosch
philippbosch / randomstring.py
Created December 16, 2014 11:40
Create random string in Python
import random
import string
length=10
code = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
@philippbosch
philippbosch / .htaccess
Last active August 29, 2015 14:20 — forked from thoop/.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@philippbosch
philippbosch / app.py
Last active July 19, 2016 08:54
Chalice Hello World
from chalice import Chalice
app = Chalice(app_name='mp3duration')
@app.route('/')
def index():
return {'hello': 'world'}
@philippbosch
philippbosch / app.py
Last active July 19, 2016 10:10
Chalice MP3 duration app
from io import BytesIO
from urllib2 import urlopen
from chalice import Chalice, BadRequestError
from mutagen.mp3 import MP3
app = Chalice(app_name='mp3info')
@app.route('/')
:root {
--ultra-light-gray: #eee;
--light-gray: #ccc;
--dark-gray: #444;
--gray: #999;
--black: #000;
--accent-1: #0098f8;
--accent-2: #00b4a6;
}
@philippbosch
philippbosch / git-blast
Created November 30, 2016 14:24 — forked from wolever/git-blast
git-blast: show git branches sorted by last commit date
#!/usr/bin/env python
"""
Shows git branches sorted by last commit date, noting when branch has been
merged:
$ git blast
* master 33 minutes ago
david 4 days ago [M]
unholy-david-payments 4 days ago
handsontable-2 5 days ago