Skip to content

Instantly share code, notes, and snippets.

@reidblomquist
reidblomquist / example.py
Created March 27, 2016 08:45
Simple RPi.GPIO Toggle button (pull up) Class
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
class Toggle:
enabled = False
def __init__(self, pin):
self.pin = pin
@reidblomquist
reidblomquist / hosts
Last active March 26, 2016 22:30
Block Distractions (Incl. IPv6)
# Enable this block for productivity
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@reidblomquist
reidblomquist / ApiBackgroundColor.cs
Last active February 5, 2016 21:10
U3D Async Json Serialization to Object
using UnityEngine;
using System;
public class ApiBackgroundColor : MonoBehaviour {
private Color backgroundColor;
private ApiClient.Rgba rgba;
private Camera camera;

KC60 Keyboard end-user tips, tricks, programming notes, etc.

Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.

The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Faddah's Life</title>
<meta name="description" content="Faddah's Life">
<meta name="author" content="Faddah">
@reidblomquist
reidblomquist / gist:45033dd6bf81ea3b658e
Created June 26, 2015 05:36
Unity3d UI Raw Image Video
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class GuiVideo : MonoBehaviour {
void Start() {
MovieTexture movie = GetComponent<RawImage>().texture as MovieTexture;
AudioSource sound = GetComponent<AudioSource>();
sound.clip = movie.audioClip;
@reidblomquist
reidblomquist / Loader.cs
Created June 22, 2015 05:55
Loader and SoundManager scripts referenced in TextTyper class
using UnityEngine;
using System.Collections;
public class Loader : MonoBehaviour {
public GameObject gameManager;
public GameObject soundManager;
void Awake () {
if (gameManager && GameManager.instance == null)
@reidblomquist
reidblomquist / gist:fdb80d5647881bcab4df
Last active September 23, 2015 17:18
gitignore for dir w/ unity project subdir
# Unity Generated
Temp
Library
# vs/mono Generated
ExportedObj
obj
*.svd
*.userprefs
@reidblomquist
reidblomquist / gist:568484bf122132b5c6a1
Created July 31, 2014 01:59
get parent id arrays - check if config or grouped
if($product->getTypeId() == "simple"){
$parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
if(!$parentIds)
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
if(isset($parentIds[0])){
$parent = Mage::getModel('catalog/product')->load($parentIds[0]);
// do stuff here
}
}
@reidblomquist
reidblomquist / gist:8daada8044e8adb9491e
Created June 10, 2014 20:05
Pull a Magento attribute's available options (in this case 'style_tag')
<?php
/* Ryaan is totes a newb */
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once('../magento/app/Mage.php');
Mage::app();
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'style_tag');
if ($attribute->usesSource()) {