Skip to content

Instantly share code, notes, and snippets.

View daneharrigan's full-sized avatar

Dane Harrigan daneharrigan

View GitHub Profile
  1. ironman 1
  2. ironman 2 - introduces tony stark's dad
  3. captain america - tony stark's dad has a small role
  4. thor - talks about the tesseract (weapon) and introduces loki
  5. avengers - talks about the tesseract and loki. introduces shield
  6. ironman 3 - tony stark has trama from the avengers fight
  7. captain american 2 - involves shield alot
  8. guardians of the galexy - has very little to do with the other movies
# Usage: git push origin master --yolo
#
# Because you only live once
function git {
local GIT_CMD=`whereis git`
for x in $@; do
if [[ "$x" == "--yolo" ]]; then
GIT_CMD="$GIT_CMD --force"
// this will only affect the input fields that exist in the html prior to this code running.
// if your application.js file exists in the <head> tag all of your input fields come after
// this code runs so it doesn't see any input fields
$("input").on("focus", function(){
console.log("at=first event=focus")
});
// similar to at=first but uses $(document) instead of $("input")
$(document).on("focus", "input", function(){
console.log("at=second event=focus")
@daneharrigan
daneharrigan / example_test.go
Last active January 2, 2016 21:49
golang BDD concept
package bdd_test
import (
"testing"
. "github.com/daneharrigan/bdd"
)
func TestSpecs(t *testing.T) {
defer Runner(t)
(function(){
var scripts = Ember.$("script[type='text/x-handlebars'][src]")
scripts.each(function(_, script){
Ember.$.ajax({
async: false,
url: script.src,
dataType: "html"
}).done(function(html){
var name = script.getAttribute("data-template-name") || "application";
Ember.TEMPLATES[name] = Ember.Handlebars.compile(html);
{"V":"3","W":"1","D":"0"}
{"V":"5","W":"1","D":"0"}
{"V":"13","W":"1","D":"0"}
{"V":"12","W":"1","D":"0"}
{"V":"2","W":"1","D":"0"}
{"V":"6","W":"1","D":"0"}
{"V":"4","W":"1","D":"0"}
{"V":"3","W":"1","D":"0"}
{"V":"14","W":"1","D":"0"}
{"V":"7","W":"1","D":"0"}
@daneharrigan
daneharrigan / kgrep
Created September 19, 2013 06:48
For parsing key-value pairs out of log streams. Example: heroku logs --tail | ./kgrep service
#!/usr/bin/env perl
#
# Usage: echo "key=value" | kgrep key
#
while($line = <STDIN>) {
if($line =~ m/($ARGV[0]+=[^\s]*)/) {
print "$1\n";
}
@daneharrigan
daneharrigan / export.go
Created August 31, 2013 02:44
The official AWS process for exporting a DynamoDB table is overly complex. These two scripts make exporting and importing much easier.
package main
import (
"bytes"
"flag"
"fmt"
"github.com/bmizerany/aws4"
"io/ioutil"
"log"
"net/http"
package main
import (
"fmt"
"os"
"time"
)
func main() {
count := 0
---
:backtrace: false
:benchmark: false
:bulk_threshold: 1000
:sources:
- http://rubygems.org
- https://heroku-internal-gems.s3.amazonaws.com/19786ce1b01a785a53f2d48d1a3d878f203bb360eb63bc29/
- https://heroku-internal-gems.s3.amazonaws.com/19786ce1b01a785a53f2d48d1a3d878f203bb360eb63bc29/
- https://heroku-internal-gems.s3.amazonaws.com/19786ce1b01a785a53f2d48d1a3d878f203bb360eb63bc29/
- https://heroku-internal-gems.s3.amazonaws.com/19786ce1b01a785a53f2d48d1a3d878f203bb360eb63bc29/