Skip to content

Instantly share code, notes, and snippets.

Smart Puck'in

Kevin Sidwar sidwarkd

Smart Puck'in
View GitHub Profile
sidwarkd /
Created Feb 20, 2014
Tracking Olympic Medals with the Raspberry Pi
import sys, urllib
from time import sleep
import spidev
def spi_send(bus, data):
xfer_list = []
if type(data) == str:
for c in data:
elif type(data) == list:
sidwarkd /
Created Mar 18, 2014
Streaming temperature readings with, TMP106, and Raspberry Pi
import RPi.GPIO as GPIO
import spidev
from time import sleep, localtime, strftime, time
import sys
import smbus
class PiHardware(object):
def __init__(self):
sidwarkd / pinode_stats.js
Last active Aug 29, 2015
Nodes JS module for getting simple runtime info from the Raspberry Pi
View pinode_stats.js
'use strict'
// An example of accessing system information on the Raspberry Pi with NodeJS
var fs = require('fs');
var PiStats = function(){
var stats = {};
var _currentCPUInfo = {total:0, active:0};
var _previousCPUInfo = {total:0, active:0};
sidwarkd / www
Last active Aug 29, 2015
A Physical Yo Button
View www
#!/usr/bin/env node
var app = require('../app');
var io = null;
app.set('port', process.env.PORT || 3000);
app.get('/new', function(req, res){
io.emit('yoReceived', req.query.username);
sidwarkd / edison_pins.json
Last active Aug 29, 2015
Descriptive JSON of Edison Mini Breakout Pins
View edison_pins.json
"jumper": 17,
"pin": 1,
"name": "GP182_PWM2",
"description": "GPIO capable of PWM output.",
"tags": ["gpio", "pwm"]
"jumper": 17,
sidwarkd / hcidump.log
Created Feb 5, 2015
Logs for BLE issue with Bleno
View hcidump.log
HCI sniffer - Bluetooth packet analyzer ver 2.4
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x0c
Error: Command Disallowed
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
sidwarkd / example.cs
Created Mar 16, 2015
A super simple way to get the list of project files from a Visual Studio Solution file.
View example.cs
public static void GetProjectFilesFromSolution(string solutionFile)
if (File.Exists(solutionFile))
string cwd = Directory.GetCurrentDirectory();
// This is a hack for reading solution files but is better than the almost 100 lines of code
// necessary to load a special MS assembly and parse the file the 'right way'
string[] solutionContents = File.ReadAllLines(solutionFile);
sidwarkd / .gitignore
Created Nov 27, 2011
Very basic Node.js app using MongoLab and Heroku
View .gitignore
sidwarkd / config.json.sample
Created Apr 1, 2015
Competitor to the Amazon Dash
View config.json.sample
"sparkAccessToken": "",
"sparkDeviceID": "",
"twilioAccountSID": "",
"twilioAuthToken": "",
"toPhoneNumber": "[NUMBER TO CALL]",
"fromPhoneNumber": "[YOUR TWILIO NUMBER]",
sidwarkd / gist:6303353
Created Aug 22, 2013
Bookmarklet To Extend Tweet Menu
View gist:6303353
$(this).prepend('<li><a role="button" class="my-custom-link" class="js-tooltip" href="#"><b>My Option</b></a></li>');
var el = $( || $(evt.srcElement);
var tweetText = el.closest(".content").find("p.tweet-text").first().text();
alert("This is the text from the tweet that you can use for something:\n\n" + tweetText);
You can’t perform that action at this time.