Skip to content

Instantly share code, notes, and snippets.

View designer.html
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
@turadg
turadg / README.md
Created Apr 1, 2015
Retracked draft
View README.md

Retracked wraps your event recording system in an API optimized for React components.

Usage

Setup

Somewhere early in execution:

# set the recording function
retracked.setup(myTrackingSystem.push);
View bug installing gource
effuse-hcii-cs-cmu-edu:~ taleahma$ brew install gource
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
######################################################################## 100.0%
==> ./configure --with-pc-path=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig --disable-debug --
==> make install
/usr/local/Cellar/pkg-config/0.23: 7 files, 220K, built in 38 seconds
==> Downloading http://www.libsdl.org/release/SDL-1.2.14.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sdl/1.2.14 --disable-debug --disable-dependency-tracking --disable-nasm
==> make install
View navigateActionExample.js
/**
* The router runs this navigate action once a new route is resolved.
* This returns a promise that must be satisfied before the render
* starts. The promise consists of all actions that each handler
* in the route declares that it needs before navigating.
*
* WHEN we upgrade react-router to 1.0, we should revisit this design
* https://github.com/rackt/react-router/pull/1158
*
* @return {Promise} to satisfy all the dependencies of the route
@turadg
turadg / gist:941550
Created Apr 26, 2011
Shim for HTML5 number input type
View gist:941550
/* Requires:
* Modernizr <http://www.modernizr.com/>
* JQuery Numeric <http://www.texotela.co.uk/code/jquery/numeric/>
*/
// require numeric input even when HTML5 not available
if (!Modernizr.inputtypes.number) {
// no native support for <input type="number">
$("input[type=number]").numeric(false, function() { alert("Integers only"); this.value = ""; this.focus(); });
}
@turadg
turadg / .htaccess
Created Sep 16, 2011
Rsync to CMU Andrew publishing and push to publish
View .htaccess
RewriteEngine on
# match any directory
RewriteCond %{REQUEST_FILENAME} -d
# redirect somewhere instead of serving it
RewriteRule ^(.*)$ http://www.cs.cmu.edu/~taleahma/ [R,NC,L]
View keybase.md

Keybase proof

I hereby claim:

  • I am turadg on github.
  • I am turadg (https://keybase.io/turadg) on keybase.
  • I have a public key whose fingerprint is 1AAF D87D B5DB 6B87 29A5 7646 0249 C9F5 1B7F 02C2

To claim this, I am signing this object:

View levenshteinDistanceMixin
# usage _.levenshteinDistance("PART", "PARTY") or _("PART").levenshteinDistance("PARTY")
_.mixin
levenshtein : (str1, str2) ->
return str2.length if str1.length == 0
distance = []
for i in [0..str1.length]
distance[i] = []
distance[i][0] = i
@turadg
turadg / poltergeist_screenshot_helper.rb
Last active Dec 15, 2015
Poltergeist screenshot helper for Rspec
View poltergeist_screenshot_helper.rb
# spec/support/poltergeist_screenshot_helper.rb
module PoltergeistScreenshotHelper
# FROM http://blog.jerodsanto.net/2012/12/capybara-and-poltergeist-snap/
def snap!(options={})
path = options.fetch :path, "~/.Trash"
file = options.fetch :file, "#{Time.now.to_i}.png"
full = options.fetch :full, true
path = File.expand_path path
@turadg
turadg / bluetooth-swap.sh
Last active Dec 22, 2015 — forked from hughsaunders/release_bt_keyboard.sh
Script to swap your Bluetooth devices connections between two Macs. Works great with iMacMonitor.app to quickly switch your iMac between being a laptop monitor or full computer. http://bogner.sh/2013/07/os-x-how-to-use-an-imac-as-monitor/
View bluetooth-swap.sh
#!/usr/bin/env bash
# This script works after you've paired the Bluetooth devices with
# both the local and remote computer. Turning one off and the other on
# forces the devices to reconnect with the only computer that has BT on.
# Look up local SSH hosts with Bonjour using `dns-sd -B _ssh`
# You may want to set up an SSH keypair to log in without typing a password
REMOTE=Stone.local
You can’t perform that action at this time.