Skip to content

Instantly share code, notes, and snippets.

View ekdevdes's full-sized avatar

Ethan Kramer ekdevdes

View GitHub Profile
@ekdevdes
ekdevdes / color.m
Created January 18, 2013 07:53 — forked from kylefox/color.m
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title></title>
<!-- iPhone -->
<link href="http://taylor.fausak.me/static/images/apple-touch-icon-57x57.png"
@ekdevdes
ekdevdes / 0_README.md
Created July 7, 2012 03:17 — forked from netzpirat/0_README.md
Continuous CoffeeScript testing with Guard and Jasmine

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard
@ekdevdes
ekdevdes / Fancy File Inputs.js
Created June 19, 2012 02:43 — forked from davist11/Fancy File Inputs.js
Fancy File Inputs
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {
@ekdevdes
ekdevdes / jasmine-ajax-example-spec.coffee
Created April 23, 2012 19:56 — forked from searls/jasmine-ajax-example-spec.coffee
A simple Jasmine Ajax spying example
window.context = window.describe
describe ".googlePandaStatus", ->
Given -> @ajaxCaptor = jasmine.captor()
Given -> spyOn($, "get")
When -> googlePandaStatus("Happy")
And -> expect($.get).toHaveBeenCalledWith("http://google.com", @ajaxCaptor.capture())
describe "~ the AJAX success handler", ->
Given -> spyOn(window, "printMessage")
@ekdevdes
ekdevdes / iOSVersionFinder
Created March 13, 2012 16:13
Find out if the device has iOS4 or iOS5 installed, and perform a version-specific action based on the results.
NSArray *versions = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
if ( 5 == [[versions objectAtIndex:0] intValue] ) { /// iOS5 is installed
// Perform iOS-5 actions here
} else { /// iOS4 is installed
// Perform iOS-4 actions here
@ekdevdes
ekdevdes / README.markdown
Created March 12, 2012 21:27 — forked from Yavari/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@ekdevdes
ekdevdes / dabblet.css
Created January 27, 2012 04:52 — forked from chriscoyier/dabblet.css
Animate to natural width
/* Animate to natural width */
body { background: black; padding: 100px; margin: 0; font-family: sans-serif; }
.progress-bar {
border: 2px solid red;
border-radius: 4px;
}
.progress-bar > div {
@ekdevdes
ekdevdes / dabblet.css
Created January 27, 2012 04:52 — forked from chriscoyier/dabblet.css
Animate to natural width
/* Animate to natural width */
body { background: black; padding: 100px; margin: 0; }
.progress-bar {
border: 2px solid red;
border-radius: 14px;
}
.progress-bar > div {
@ekdevdes
ekdevdes / StripeTutorialPage.html
Created October 3, 2011 04:06
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below