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
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | |
// ... | |
_window_focus: __bind(function(e) | |
{ | |
Ti.API.info('window_focus - enter'); | |
if (this.performedInitialFocus == false) | |
{ | |
this.performedInitialFocus = true; | |
this._nearbyButton_click(); |
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
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | |
function MyClass() { | |
this.my_method = __bind(this.my_method, this); | |
this.my_other_method = __bind(this.my_other_method, this); | |
} | |
MyClass.prototype.my_method = function(arg1) { | |
return arg1; | |
} |
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
function formatJSONTime(jsonTime){ | |
var matches = jsonTime.match(/date\((\d{13})\)/), | |
date = matches !== null ? formatTime(new Date(+matches[0])) : +new Date(); | |
return date; | |
} |
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
function formatTime(e) | |
{ | |
var _hour = e.getHours(), | |
_min = e.getMinutes(), | |
_ampm = +_hour >= 12 ? " PM" : " AM", | |
_nice_hour = ((+_hour % 12)+"").replace(/^0$/, "12"); | |
return _nice_hour + ":" + _min + _ampm; | |
} |
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
function IsNumeric(e) | |
return Object.prototype.toString.call(e) == '[object Number]'; | |
} |
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
function formatCurrency(amount) | |
{ | |
var i = parseFloat(amount); | |
if (isNaN(i)) { i = 0.00; } | |
var minus = ''; | |
if (i < 0) { minus = '-'; } | |
i = Math.abs(i); | |
i = parseInt((i + 0.005) * 100, 10); | |
i = i / 100; | |
s = ''; |
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
<?php | |
class Simplate { | |
/* | |
* Sets include file name, and sanitizes vars. | |
*/ | |
function __contruct($template_name = '404', $vars = array()) { | |
// Escapt all values by default. | |
$this->template_vars = $this->sanitize_vars($vars); |
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
jsdom = require 'jsdom' | |
dataz = [] | |
listings = 1000 | |
http_host = "http://www.stormscape.com" | |
path = "/inspiration/website-lists/global1000/" | |
# Build up the list of url's to visit. | |
urls = for page in [0..9] |
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
class Testing123 | |
contructor: -> | |
console.log "you're in the constructor." | |
my_unbound_method: -> | |
console.log "I don't have to be bound, because I don't do anything that needs `this`" | |
my_bound_method: => | |
my_unbound_method() |
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
sprintf_re = /%\({1}([a-zA-Z0-9_]+)\){1}/ | |
sprintf = (str, obj) -> | |
((if obj.hasOwnProperty(a) then obj[a] else a) for a in str.split sprintf_re).join("") | |
console.log(sprintf("%(quantity) @ %(weight)", {quantity: 13, weight: 42})) |