Skip to content

Instantly share code, notes, and snippets.

View nippe's full-sized avatar
:octocat:
Cruzin'

Niklas Nihlén nippe

:octocat:
Cruzin'
View GitHub Profile
@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: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: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: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: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: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