Skip to content

Instantly share code, notes, and snippets.

View drewbaumann's full-sized avatar
:octocat:
Coding up a storm

Drew Baumann drewbaumann

:octocat:
Coding up a storm
View GitHub Profile

Keybase proof

I hereby claim:

  • I am drewbaumann on github.
  • I am drewbaumann (https://keybase.io/drewbaumann) on keybase.
  • I have a public key ASDnfvyysC5ccN_lqQ9zyIGXui4TqVcx5eALIkSUecvnKgo

To claim this, I am signing this object:

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}
@drewbaumann
drewbaumann / keymap_drew.c
Created August 9, 2015 00:23
DB Mod HHKB keymap
/*
* HHKB Layout - DB Mod
*/
#include "keymap_common.h"
#ifdef KEYMAP_SECTION_ENABLE
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
#endif
require 'benchmark'
count = 1000000
Benchmark.benchmark do |bm|
bm.report("concat") { count.times { 11.to_s + '/' + 12.to_s } }
bm.report("interp") { count.times { "#{11}/#{12}" } }
bm.report("join") { count.times { ["11", "12"].join("") } }
end
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman" loop="2">Hello, your verification code is: 1,2,3,4 </Say>
</Response>
{
"name": "es5-shim",
"npmName": "es5-shim",
"npmFileMap": [
{
"basePath": "/",
"files": [
"es5*"
]
}
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/Z2RZmeXwpVA" width="420"></iframe>
require_relative "string"
module Mirror
module Api
module HashKeyConversion
def convert_hash_keys(value, case_type="")
case value
when Array
value.map { |v| convert_hash_keys(v) }
# or `value.map(&method(:convert_hash_keys))`
when Hash
@drewbaumann
drewbaumann / exportjson.js
Created February 29, 2012 23:38 — forked from pamelafox/exportjson.js
Google Spreadsheet JSON Export
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@drewbaumann
drewbaumann / gist:1650990
Created January 21, 2012 03:03
all the parameters
Parameters: {"fb_page"=>{"_id"=>"4f19f6f9338e56d9f2000001", "admins"=>[{"admin"=>{"_id"=>"4f1a08bc338e56108f000001", "admin"=>{"admin"=>{"_id"=>"4f19f70b338e56d9f2000002", "fb_id"=>"66001693", "token"=>"AAAEVtn0LL3QBAOxhQ5M4vK7K4BMarPKa8spEfstJxAcMZC1Qj2eu8zZCMe7pbTSNdWMSOipz7ytfaKmm9HkyPuCOfqjLIZD"}}, "fb_id"=>nil, "token"=>nil}}], "banner_logo"=>{"original_filename"=>"test-for-fb-tab.png", "content_type"=>"image/png", "headers"=>"Content-Disposition: form-data; name=\"fb_page[banner_logo]\"; filename=\"test-for-fb-tab.png\"\r\nContent-Type: image/png\r\n", "tempfile"=>["�PNG\r\n", "\u001A\n", "\u0000\u0000\u0000\rIHDR\u0000\u0000\u0002\b\u0000\u0000\u0000K\b\u0006\u0000\u0000\u0000\u0015�\u007F�\u0000\u0000\u0000\u0019tEXtSoftware\u0000Adobe ImageReadyq�e<\u0000\u0001�MIDATx�\\�\t�%�u\u001D����[��}������zG��Fwc\a\u0001\u0010$\b\u000E)�\u0012���LIa�G�g\u001C��D��31���\t�3���L�\u0012e��\n", "�\u0000\b\u0010;��}��������[.��9Y�4l\u0004�]U?\u007F����=�����)����Z6���RP�+�F���\u0003/��Y���\n", "��o\u0006K#\u0017��