Skip to content

Instantly share code, notes, and snippets.

View nippe's full-sized avatar
🏠
Working from home

Niklas Nihlén nippe

🏠
Working from home
View GitHub Profile
@nippe
nippe / gist:5080813
Created March 4, 2013 08:21
Raspberry Pi /etc/networking/interfaces before editing
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
@nippe
nippe / gist:5233681
Created March 24, 2013 21:46
Raspbery Pi /etc/network/interfaces - wifi configured
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid network-name
wpa-psk password
@nippe
nippe / gist:5282104
Last active December 15, 2015 15:29
Script for logging some 1wire data to Cosm.org
require 'cosm-rb'
require 'json'
require 'ap'
def get_path_for_family path, directory_path
family = File.open(File.join(path, directory_path, 'family')).gets.strip.to_i
if family == 28
File.join(path, directory_path, 'temperature')
elsif family == 26
File.join(path, directory_path, 'humidity')
@nippe
nippe / gist:5282338
Created March 31, 2013 22:53
Logging datapoints to tempo-db.com.
require 'tempodb'
def get_path_for_family path, directory_path
family = File.open(File.join(path, directory_path, 'family')).gets.strip.to_i
if family == 28
File.join(path, directory_path, 'temperature')
elsif family == 26
File.join(path, directory_path, 'humidity')
else
nil
@nippe
nippe / gist:5795761
Last active December 18, 2015 14:18
Route in NancyFX using LightningCache's AsCacheable extention method.
Get["/builds/progress"] = _ => {
IList<IBuildInProgress> builds = serviceAgent.GetBuildsInProgress();
return Response.AsJson(builds).AsCacheable(DateTime.Now.AddSeconds(10)) ;
};
@nippe
nippe / gist:13fc6435eb281928c87c
Created January 6, 2015 17:00
Azure WebSite Node.js version
{
"nodejs": [
{
"version": "0.10.18",
"npm": "1.3.8"
},
{
"version": "0.10.21",
"npm": "1.3.11"
},
@nippe
nippe / gist:66254c5f11c1f59addfa
Last active August 29, 2015 14:12
package.json
{
"name": "node-version",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"engines": {
"node": "0.10.32"
},
$ npm install —save hubot-slack
$ git init
$ git add .
$ git commit -m “Initial Commit”
$ bin/hubot
Hubot> Hubot help
Hubot adapter - Reply with the adapter
Hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
Hubot echo <text> - Reply back with <text>
Hubot help - Displays all of the help commands that Hubot knows about.
Hubot help <query> - Displays all help commands that match <query>.
Hubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
Hubot map me <query> - Returns a map view of the area returned by `query`.
Hubot mustache me <query> - Searches Google Images for the specified query and mustaches it.