# 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
Graphics 800,600,32,2 | |
SetBuffer BackBuffer() | |
img=LoadImage( "_release/samples/mak/b3dlogo.jpg" ) | |
while Not KeyDown(1) | |
Cls | |
Color 255,255,255 |
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
module ActiveModel | |
class Name | |
alias_method :org_initialize, :initialize | |
def initialize(klass, namespace = nil, name = nil) | |
if klass.respond_to?(:route_key) && name.nil? | |
org_initialize(klass, namespace, klass.route_key) | |
else | |
org_initialize(klass, namespace, name) | |
end | |
end |
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
# Date.parse() with Ruby 1.9 is now defaulting to the European date style where the format is DD/MM/YYYY, not MM/DD/YYYY | |
# patch it to use US format by default | |
class Date | |
class << self | |
alias :euro_parse :_parse | |
def _parse(str,comp=false) | |
str = str.to_s.strip | |
if str == '' | |
{} | |
elsif str =~ /^(\d{1,2})[-\/](\d{1,2})[-\/](\d{2,4})/ |