Skip to content

Instantly share code, notes, and snippets.

View robertcedwards's full-sized avatar
🖼️
Framing

Robert C Edwards robertcedwards

🖼️
Framing
View GitHub Profile
@SergXIIIth
SergXIIIth / gist:1628715
Created January 17, 2012 20:31
The first Arduino HTTP request
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0xAB, 0xCB, 0xCD, 0xDE, 0x02 };
IPAddress ip(192,168,0,140);
IPAddress server(173,194,70,103);
EthernetClient client;
import socket
import struct
import binascii
from time import sleep
from phue import Bridge
b = Bridge('192.168.1.247') # Enter bridge IP here.
turnOn = {'transitiontime' : 1, 'hue' : 34112, 'sat' :254, 'on' : True, 'bri' : 254}
turnOff = {'on' : False}
@joewalnes
joewalnes / home-yet.py
Created December 14, 2012 03:12
Am I home yet?
#!/usr/bin/env python
"""A tiny script that polls your location on Google Latitude, and updates
the color of a Blink1 LED. http://shop.thingm.com/blink1/
Red = At work
Blue = At home
Green = On my way
Should work on Windows, OS-X and Linux. Requires Python 2.7 or later.
anonymous
anonymous / gist:0e2e50e58855a352d936b2faa1d864c5
Created December 1, 2017 18:09
Rotate pi touch screen 7" after modding boot/config.txt
in case of inverting rotate (clockwise 180 degree),
⎡-1 0 1 ⎤
⎜ 0 -1 1 ⎥
⎣ 0 0 1 ⎦
@visnup
visnup / README.md
Last active September 18, 2017 02:25
RICOH THETA S live 360º video stream rendering in Chrome via WebGL and a <video> texture

To get this working, you'll need the [live-streaming software from RICOH][1]. Install that and follow the [live video instructions][2] to connect your camera to your computer and have it show up as a video source.

If you're on a Mac, you can open up the FaceTime app and test it by picking "THETA UVC Blender" from the Video menu.

Once all of that is working, open up index.html and you should see the video rendered on the inside of a sphere that you can rotate around. Use the mouse to click and drag to move the camera around and the mouse wheel to zoom in and

@hwatkins
hwatkins / ratings.rb
Created December 2, 2011 23:15
A script to use the Netflix paginated "What You've Rated" to pull what you have rated in Netflix. This call is not exposed in the Netflix API so it's hard to get any other way. This is quick and dirty so not the best Ruby constructs.
#!/usr/bin/env ruby
require 'iconv'
require 'nokogiri'
# This is a simple script to spider your Netflix paginated "What You've Rated" list.
# It requires an OS X based system with Ruby 1.9+, Safari, and AppleScript
#
# I could not find a way to back up my ratings (for all titles, not just my rental activity)
# without registering for a Netflix API key or handing my Netflix credentials over to someone
# who had an API key, so I decided to take a brute force approach and just parse the HTML for
@hardillb
hardillb / wemo-light.js
Last active November 3, 2016 08:08
Wemo lights example - "npm install wemo-js xml2js" then "node wemo-light.js" for instructions
var wemo = require('wemo-js');
var http = require('http');
var util = require('util');
var xml2js = require('xml2js');
var postbodyheader = [
'<?xml version="1.0" encoding="utf-8"?>',
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">',
'<s:Body>'].join('\n');
@JadenGeller
JadenGeller / SwiftPackages.md
Last active February 20, 2016 19:32
Swift Packages by Jaden Geller

Matrices with friendly semantics and a familiar interface

var x: Matrix = [[1, 2, 3], [5, 6, 7]]
x.columns.append([4, 8])
let y = -x * x.transpose
assert(y.determinant == 320)
@mattmakesmaps
mattmakesmaps / README.md
Last active December 18, 2015 04:29
Coffee flavor profiles by brew method.

This d3 visualization represents Scott Rao's great graph depicting the relationship between different coffee brew methods and flavor profiles.

Brew methods to the left have the Most Body, Least Flavor Clarity, while brew methods to the right have the Least Body, Most Flavor Clarity. Larger circles represent a greater range in filter porosity.

Specifically, this is based on, via, and ripped off from.

@erikhazzard
erikhazzard / gist:af39b59b2e6b8255bde2
Last active December 16, 2015 20:12
Mixpanel set avatar image URL
$('#userlist_wrapper .grid_row').each(function(i, el){
var el = $(el);
var id = el.attr('data-distinct_id');
$('.avatar_cell img', el).attr(
'src',
'YOUR_URL_FOR_IMAGE/' + id + '.gif'
);
})