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
| # On branch jstagger | |
| # Changes to be committed: | |
| # (use "git reset HEAD <file>..." to unstage) | |
| # | |
| # deleted: ../beta_signup/index.html | |
| # deleted: ../groups/list/groups.html | |
| # deleted: ../groups/view/group_view.html | |
| # deleted: ../splash/home_nohh.html | |
| # renamed: ../upload/simple_upload.html -> ../upload/upload_simple.html | |
| # deleted: pulse.html |
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
| <<<<<<< HEAD:blacktip/api/bounding_box.py | |
| from django.db import transaction | |
| ======= | |
| from cStringIO import StringIO | |
| from decimal import Decimal | |
| from PIL import Image | |
| from urllib2 import urlopen | |
| from django.db import transaction |
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
| Number.prototype.apnumber = function() { | |
| var numberMap = | |
| [ 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine' ]; | |
| return (9 >= this) ? numberMap[this] : this; | |
| }; | |
| // Examples | |
| var foo = 4; | |
| alert(foo); // 4 |
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
| String.prototype.shorten = function(n, i) { | |
| var indicator = i || '…'; | |
| return (this.length > n) ? String(this.substr(0, n)+indicator) : String(this); | |
| }; | |
| // Examples | |
| var foo = 'Snuggleuffagus'; | |
| alert(foo.shorten(10)); // Snuggleuff… | |
| alert(foo.shorten(3, '»')); // Snu» |
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
| Number.prototype.pluralize = function(singular, plural) { | |
| var a = '', b = 's'; | |
| if (singular && plural) { a = singular; b = plural; } | |
| return (this == 1) ? a : b; | |
| }; | |
| // Examples | |
| function cherries(numCherries) { | |
| alert('You have '+numCherries+' cherr'+numCherries.pluralize('y', 'ies')+' in mai bucket.'); | |
| }; |
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
| $sizes = array( | |
| "WB-1" => array( | |
| "men" => array('6', '7', '8', '9', '10', '11', '12'), | |
| "women" => array('5', '6', '7', '8', '9', '10', '11', '12') | |
| ), | |
| "WK-1" => array( | |
| "men" => array('4', '5', '6', '7', '8', '9', '10', '11'), | |
| "women" => array('4', '5', '6', '7', '8', '9', '10', '11') | |
| ), | |
| "WK-79" => array( |
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
| $sizes = array( | |
| "WB-1" => array( | |
| "men" => array('6', '7', '8', '9', '10', '11', '12'), | |
| "women" => array('5', '6', '7', '8', '9', '10', '11', '12') | |
| ), | |
| "WK-1" => array( | |
| "men" => array('4', '5', '6', '7', '8', '9', '10', '11'), | |
| "women" => array('4', '5', '6', '7', '8', '9', '10', '11') | |
| ), | |
| "WK-79" => array( |
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
| if (self.groups) { | |
| var g = new Array(), g_strings = new Array(); | |
| for (group in self.groups) { | |
| g.push({ id: group, name: self.groups[group] }); | |
| } | |
| for (var i=0; i < g.length; i++) { | |
| var g_suffix = (i == g.length) ? ' and ' : ''; | |
| var g_string = '<a href="/dashboard/ents/'+g[i].id+'/">'+g[i].name+'</a>'+g_suffix; | |
| g_strings.push(g_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
| # Screwing around... | |
| String.prototype.inter = function(r) { | |
| return this.replace(/\{([^}]+)\}/g, function() { | |
| return r[arguments[1]]; | |
| }); | |
| } | |
| $(document).ready(function() { | |
| var string = 'There are {num_kids} kids in the {room_name}.'; |
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
| // Screwing around with string interpolation | |
| String.prototype.inter = function(r) { | |
| return this.replace(/\{([^}]+)\}/g, function() { | |
| return r[arguments[1]]; | |
| }); | |
| } | |
| $(document).ready(function() { | |
| var string = 'There are {num_kids} kids in the {room_name}.'; |
OlderNewer