Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View FredrikL's full-sized avatar
👽

Fredrik Leijon FredrikL

👽
View GitHub Profile
@FredrikL
FredrikL / gist:fe7cb4f214093f4c89cd
Created July 8, 2015 06:22
tdtool.py modification
def get_temps():
client = InfluxDBClient('localhost', 8086, 'root', 'root', 'house_temp')
wilma = doRequest('sensor/info', {'id': 1210772})
ute = doRequest('sensor/info', {'id': 2648581})
sovrum = doRequest('sensor/info', {'id': 2613562})
mini = doRequest('sensor/info', {'id': 2613527})
forrad = doRequest('sensor/info', {'id': 2613616})
vardagsrum = doRequest('sensor/info', {'id': 2613316 })
uppe = doRequest('sensor/info', {'id': 2613599})
@FredrikL
FredrikL / gist:a0f149414411c1874a53
Created July 8, 2015 06:26
ping stats to influxdb
require 'net/ping'
require 'influxdb'
@icmp = Net::Ping::External.new('8.8.8.8')
rtary = []
pingfails = 0
repeat = 5
(1..repeat).each do
if @icmp.ping
[Punisher, Tournament v3]
Centii C-Type Adaptive Nano Plating
Imperial Navy Energized Adaptive Nano Membrane
Gyrostabilizer II
400mm Reinforced Rolled Tungsten Plates I
1MN Afterburner II
Stasis Webifier II
200mm AutoCannon II, Republic Fleet EMP S
[Pilgrim, ninja ratter]
Medium Armor Repairer II
Damage Control II
Armor EM Hardener II
Armor Thermic Hardener II
Heat Sink II
10MN Afterburner II
Cap Recharger II
Cap Recharger II
@FredrikL
FredrikL / gist:1038709
Created June 21, 2011 19:47
IronRuby + C#
using System;
using Microsoft.Scripting.Hosting;
using IronRuby;
namespace IronRubyHostTest
{
public class Meh
{
public void baz()
{
#!/usr/bin/env ruby
# Command line util for acquiring a one-off Twitter OAuth access token
# Based on http://blog.beefyapps.com/2010/01/simple-ruby-oauth-with-twitter/
require 'rubygems'
require 'oauth'
puts <<EOS
Set up your application at https://twitter.com/apps/ (as a 'Client' app),
@FredrikL
FredrikL / Wheels.cs
Created March 6, 2012 08:45
Motors n stuff
public class Wheels : IWheels
{
private readonly OutputPort motorOneDirection;
private readonly OutputPort motorTwoDirection;
private readonly PWM motorOneSpeed;
private readonly PWM motorTwoSpeed;
public Wheels(Cpu.Pin motorOneDirectionPin, Cpu.Pin motorOneSpeedPin,
Cpu.Pin motorTwoDirectionPin, Cpu.Pin motorTwoSpeedPin)
#include "LPD8806.h"
#include "SPI.h"
// code revision for my version of http://www.youtube.com/watch?v=IUhEINPraN8&feature=youtu.be
int aX = 0;
int aY = 1;
int aZ = 3;
int stripDataPin = 2;
@FredrikL
FredrikL / foo.cs
Created April 19, 2012 10:05
ToArray
using System.Linq;
namespace Baz
{
public class Foo
{
public byte[] Bar()
{
byte[] b = new byte[] {};
@FredrikL
FredrikL / make_token.rb
Created May 8, 2012 19:00 — forked from mirakui/make_token.rb
To get twitter/oauth access token
require 'twitter_oauth'
print 'Consumer Key> '
consumer_key = gets.chomp
print 'Consumer Secret> '
consumer_secret = gets.chomp
t = TwitterOAuth::Client.new(
:consumer_key => consumer_key,