Skip to content

Instantly share code, notes, and snippets.

View littlelazer's full-sized avatar

Eryan Cobham littlelazer

  • Chicago, Illinois
View GitHub Profile
@littlelazer
littlelazer / carData2012
Created April 17, 2012 20:26 — forked from vinniewrote/carData2012
Format example for Epicor JSON file
carData = {
    1962 : {
        Alfa Romeo : {
            2000 : {
             Sedan : {
        "4" : { /* more info about the 4 door models */ },
"2" : { /* more info about the 4 door models */ }
        },
        Wagon:{
         numDoors:"2"
@littlelazer
littlelazer / demo.html
Created April 24, 2012 17:14 — forked from dryan/demo.html
Utility function for translatable strings in JavaScript. See demo.html for usage examples.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Translation Demo</title>
<meta charset="utf-8">
</head>
<body>
<p id="hello"></p>
<h1>Usage</h1>
<p>Create an object called <code>translations</code> attached to the <code>window</code> object. That object should have a key for each language you want to support that points to an object containing key/value pairs for all of your strings.</p>
@littlelazer
littlelazer / uri.js
Created May 2, 2012 16:57 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@littlelazer
littlelazer / git-fresh
Created May 24, 2012 18:10 — forked from thetristan/git-fresh
Quick shell script to check the freshness of your git branches
#!/bin/bash
#
# Place this file somewhere in your path and make it executable
# Can then be ran within any repo by calling `git fresh` within that folder
#
(
for b in `git branch | sed 's:^[ *]*::'`
do
git log -n 1 $b -- | sed -e '4,$ d' -e '1,2 d' -e "s^Date:[ ]*^^" -e "s^\(.*\)$^\1 ~~~ ${b}^"
done
@littlelazer
littlelazer / gist:2911221
Created June 11, 2012 16:53
arstechnica liveblogging
(function(){
var timer = null;
var status_timer = null;
var loaded = false;
var interval = 3 * 1000;
var status_interval = 60 * 1000;
var update = true;
@littlelazer
littlelazer / gist:3000559
Created June 27, 2012 00:59 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Keybase proof

I hereby claim:

  • I am littlelazer on github.
  • I am littlelazer (https://keybase.io/littlelazer) on keybase.
  • I have a public key whose fingerprint is B1E3 9848 8B47 00DB 00B6 3903 662C 059D 9BD9 AB57

To claim this, I am signing this object:

@littlelazer
littlelazer / finder-iterm.app
Created June 10, 2014 20:56
Open Finder Folder in iTerm tab
on run {input, parameters}
tell application "Finder"
set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
end tell
CD_to(dir_path)
end run
on CD_to(theDir)
tell application "iTerm"
activate

Overview

Here, you might lay out the reasons behind writing this code. You can link to specs, issues, or bugs in order to give someone a better idea of how a decision was made. This is your chance to give context to your reviewer. Ego depletion - the idea that willpower is used up over time - can be easily applied to your reviewer. We are human, after all. You'll likely get one shot at a quality review, so help your reviewer help you. Flush out this section.

Testing

How did you test this code? Did you write a unit test, or test it manually? Can you provide an animated gif or a screenshot to demonstrate your code does what it purports to do? What about test output or a useful snippet from a logfile? Help show that your code works.

🚨🚨🚨 (Risks)

Is there some part of the code that you know probably doesn't work as it should? Call out potential weak spots, and get help addressing them.

@littlelazer
littlelazer / capybara cheat sheet
Created June 13, 2017 17:45 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')