# 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Animate to natural width */ | |
body { background: black; padding: 100px; margin: 0; } | |
.progress-bar { | |
border: 2px solid red; | |
border-radius: 14px; | |
} | |
.progress-bar > div { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( ($) -> | |
$.fn.pluginName (options) -> | |
return @.each( -> | |
); | |
)(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://jsfiddle.net/api/user/zalun/demo/list.json?sort=framework&limit=20&start=21">NSString <code>query</code> test</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://jsfiddle.net/api/user/zalun/demo/list.json?sort=framework&limit=20&start=21">NSString <code>query</code> test</a> |
OlderNewer