Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Niklas Nihlén nippe

🏠
Working from home
View GitHub Profile
@nippe
nippe / gist:5080813
Created Mar 4, 2013
Raspberry Pi /etc/networking/interfaces before editing
View gist:5080813
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 Mar 24, 2013
Raspbery Pi /etc/network/interfaces - wifi configured
View gist:5233681
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 Dec 15, 2015
Script for logging some 1wire data to Cosm.org
View gist:5282104
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 Mar 31, 2013
Logging datapoints to tempo-db.com.
View gist:5282338
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 Dec 18, 2015
Route in NancyFX using LightningCache's AsCacheable extention method.
View gist:5795761
Get["/builds/progress"] = _ => {
IList<IBuildInProgress> builds = serviceAgent.GetBuildsInProgress();
return Response.AsJson(builds).AsCacheable(DateTime.Now.AddSeconds(10)) ;
};
@nippe
nippe / gist:13fc6435eb281928c87c
Created Jan 6, 2015
Azure WebSite Node.js version
View gist:13fc6435eb281928c87c
{
"nodejs": [
{
"version": "0.10.18",
"npm": "1.3.8"
},
{
"version": "0.10.21",
"npm": "1.3.11"
},
View gist:66254c5f11c1f59addfa
{
"name": "node-version",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"engines": {
"node": "0.10.32"
},
View gist:338444a8f56db01f8292
$ git init
$ git add .
$ git commit -m “Initial Commit”
View gist:718f863f5a57dcd0c7bc
$ 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.