# 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 hidden or 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
| # Add this config | |
| $ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib | |
| # Login to Heroku CLI | |
| $ heroku run bash | |
| # The second argument here is the path to your script | |
| ~ $ ~/php/bin/php -f ~/www/index.php |
This file contains hidden or 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
| <? | |
| $trello_key = '123412341234123412341234'; | |
| $trello_api_endpoint = 'https://api.trello.com/1'; | |
| $trello_list_id = '1234123412341234123412341234'; | |
| $trello_member_token = '12341234123412341234123412341234'; // Guard this well | |
| $ch = curl_init("$trello_api_endpoint/cards"); | |
| curl_setopt_array($ch, array( | |
| CURLOPT_SSL_VERIFYPEER => false, // Probably won't work otherwise | |
| CURLOPT_RETURNTRANSFER => true, // So we can get the URL of the newly-created card |
This file contains hidden or 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> | |
| <!-- NOTES | |
| Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. | |
| another take on the solution first seen here: https://gist.github.com/1372229 | |
| https://github.com/joelambert/ScrollFix/issues/2 | |
| Tested on iPad 2, using IOS 5.0.1. | |
This file contains hidden or 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> | |
| <!-- NOTES | |
| Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. Tested on iPad 1, using IOS 5.1. | |
| This approach uses a set of 3 nested divs. | |
| OuterDiv -- fixed height, width, overflow-scrolling: touch; | |
| MiddleDiv -- fixed height width, overflow-scrolling: touch; fits inside OuterDiv | |
| InnerDiv -- fixed height width, bigger than MiddleDiv, so it kicks in the overflow behavior |
This file contains hidden or 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
| <?php | |
| $db_host='dbserver'; | |
| $db_name='dbame'; | |
| $db_user='dbuser'; | |
| $db_passwd='dbpassword'; | |
| mysql_connect($db_host, $db_user, $db_passwd) | |
| or die('Could not connect: ' . mysql_error()); | |
| mysql_select_db($db_name) or die('Could not select database'); |
This file contains hidden or 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
| <?php | |
| /* | |
| * Converts CSV to JSON | |
| * Example uses Google Spreadsheet CSV feed | |
| * csvToArray function I think I found on php.net | |
| */ | |
| header('Content-type: application/json'); | |
| // Set your CSV feed |
This file contains hidden or 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> | |
| <meta charset=utf-8> | |
| <meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1"> | |
| <meta name=apple-mobile-web-app-capable content=yes> | |
| <meta name=apple-mobile-web-app-status-bar-style content=black> | |
| <title>Test fullscreen</title> | |
| <style> | |
| html, body { | |
| margin: 0; | |
| padding: 0; |
This file contains hidden or 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
| var getCachedJSON = function (url, callback) { | |
| var cachedData = window.localStorage[url]; | |
| if (cachedData) { | |
| log('Data already cached, returning from cache:', url); | |
| callback(JSON.parse(cachedData)); | |
| } else { | |
| $.getJSON(url, function (data) { | |
| log('Fetched data, saving to cache:', url); | |
| window.localStorage[url] = JSON.stringify(data); | |
| callback(data); |
This file contains hidden or 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 Format 1.2.3 | |
| * (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
| * MIT license | |
| * | |
| * Includes enhancements by Scott Trenda <scott.trenda.net> | |
| * and Kris Kowal <cixar.com/~kris.kowal/> | |
| * | |
| * Accepts a date, a mask, or a date and a mask. | |
| * Returns a formatted version of the given date. |