Skip to content

Instantly share code, notes, and snippets.

View stenehall's full-sized avatar
🧗‍♂️

Johan Stenehall stenehall

🧗‍♂️
View GitHub Profile
@stenehall
stenehall / A-Pen-by-Johan-Stenehall.markdown
Created February 17, 2014 18:11
A Pen by Johan Stenehall.
@stenehall
stenehall / keybase.md
Created April 18, 2014 21:39
keybase.md

Keybase proof

I hereby claim:

  • I am stenehall on github.
  • I am stenehall (https://keybase.io/stenehall) on keybase.
  • I have a public key whose fingerprint is 4F87 EC42 F15A 130F BC5F DE22 280C DD00 03FE 0F81

To claim this, I am signing this object:

@stenehall
stenehall / test.html
Last active August 29, 2015 14:17
Websockets on Safari ios 8.2 - Home screen not working
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var server = "<replace with your server - for example weechat.mydomain.tld>";
var port = "<replace with your port - most likely 9001>";
int pin = A0;
void setup() {
}
void loop() {
int newVal = analogRead(A0);
if(newVal > 300) {
# Description
# Web hook for the Stockholm coffee brewer
#
# Commands
# there's no commands.
# Author:
# Johan Stenehall <johan@narrativeteam.com> (https://github.com/stenehall)
#
# Contributors:
# Joakim Berglund <joakim@getnarrative.com> (https://github.com/Berglund)
@stenehall
stenehall / app.js
Created April 22, 2015 14:09
Express app for Narratives coffeemaker
var stateCount = 0;
var timer;
var resetTimer;
var brewing = false;
app.post('/brew_hook', function(req, res) {
stateCount++;
clearTimeout(resetTimer);
$ cd ~/Desktop $ sudo mv /Library/Preferences/com.apple.Bluetooth.plist .
$ sudo mv ~/Library/Preferences/com.apple.Bluetooth.plist .
$ sudo mv ~/Library/Preferences/ByHost/com.apple.Bluetooth.* .
sudo chown -R _mysql /usr/local/var/mysql
sudo chmod -R o+rwx /usr/local/var/mysql
desc 'deploy to github'
task :deploy do
puts 'deploying'
sh "git add . && git commit -a -m 'Adding new content' && git push"
puts 'done!'
end
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
# rake new future=0 title="New post title goes here" slug="slug-override-title"
task :new do
require 'rubygems'
require 'chronic'
require 'stringex'
require 'active_support'
title = ENV["title"] || "New Title"
future = ENV["future"] || 0