A Pen by Johan Stenehall on CodePen.
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:
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
<!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>"; |
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
int pin = A0; | |
void setup() { | |
} | |
void loop() { | |
int newVal = analogRead(A0); | |
if(newVal > 300) { |
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
# 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) |
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
var stateCount = 0; | |
var timer; | |
var resetTimer; | |
var brewing = false; | |
app.post('/brew_hook', function(req, res) { | |
stateCount++; | |
clearTimeout(resetTimer); |
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
$ 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.* . |
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
sudo chown -R _mysql /usr/local/var/mysql | |
sudo chmod -R o+rwx /usr/local/var/mysql |
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
desc 'deploy to github' | |
task :deploy do | |
puts 'deploying' | |
sh "git add . && git commit -a -m 'Adding new content' && git push" | |
puts 'done!' | |
end |
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
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 |
OlderNewer