Skip to content

Instantly share code, notes, and snippets.

View ekdevdes's full-sized avatar

Ethan Kramer ekdevdes

View GitHub Profile
@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
@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 / 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 / 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 / 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 / source.coffee
Created April 17, 2012 12:43
CoffeeScript: Simple jQuery Plugin Template
( ($) ->
$.fn.pluginName (options) ->
return @.each( ->
);
)(jQuery);​
@ekdevdes
ekdevdes / humanize.rb
Last active December 18, 2020 16:46
Ruby: Humanize a string (the first "real" ruby method I've ever written. It was approximately 2 years ago)
# words must be seperated by an underscore
# ex. "hello_there-pal" isnt valid but "hello_there_pal" is
# humanize "hello_there" # => "Hello There"
# humanize "hello there" # => "Hello There"
# humanize "hello_there", {format: :class,without: :dashes, separator: :space}
# options
# format:
# :class -> change a string like "hello string" to "HelloString"
# :sentence -> change a string like "hello_String" to "Hello string"
@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 / AExmK.html
Created June 8, 2012 20:28
[HTML] query test (posted via Fiddles for iOS)
<a href="http://jsfiddle.net/api/user/zalun/demo/list.json?sort=framework&limit=20&start=21">NSString <code>query</code> test</a>
@ekdevdes
ekdevdes / AExmK.html
Created June 12, 2012 20:35
[HTML] query test (posted via Fiddles for iOS)
<a href="http://jsfiddle.net/api/user/zalun/demo/list.json?sort=framework&limit=20&start=21">NSString <code>query</code> test</a>