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
// Use an AMD package here to gain access to nested internal modules. | |
require.config({ | |
packages: [{ | |
name: "jquery", | |
location: "vendor/jquery/src", | |
main: "index.js" | |
}] | |
}); | |
// If we are using AMD, we don't care about core. |
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
The error: | |
Error: Error: ENOENT, no such file or directory '/Users/Jmeas/Bocoup/admiralty/client.src/client.src/core/index.js' | |
--------- | |
The directory structure: | |
client.src/ | |
bower_components/ |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// jQuery Deparam - v0.1.0 - 6/14/2011 | |
// http://benalman.com/ | |
// Copyright (c) 2011 Ben Alman; Licensed MIT, GPL | |
(function(window) { | |
// Creating an internal undef value is safer than using undefined, in case it | |
// was ever overwritten. | |
var undef; | |
// A handy reference. | |
var decode = decodeURIComponent; |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Detect Credit Card Type</title> | |
</head> | |
<body> |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Detect Credit Card Type</title> | |
<style type="text/css"> | |
#cards, #statuses { | |
padding-left: 5px; |
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
if request.method == 'GET': | |
id = request.GET['id'] | |
tagging = Images.objects.get(id=id) | |
tags = Tag.objects.usage_for_model(tagging, counts=True) | |
usageNum = [{"tag": tagfreq.name, "count": tagfreq.count} for tagfreq in tags] | |
dump = simplejson.dumps(usageNum) | |
message = dump | |
$.getJSON('/tags/', | |
{ |
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 () { | |
// export the API, but also create a global called "foo" | |
foo = module.exports = function (s) { | |
console.log('foo1 (global): ' + 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
// Initially zero. When decremented to zero, fires callback | |
function semaphore( callback ) { | |
var fn = callback, | |
count = 0; | |
return { | |
increment: function() { | |
count++; | |
}, | |
decrement: function() { | |
if( count > 0 ) { |
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
// Define whatever global space vars you might need. | |
var mbta = { | |
// application configuration parameters | |
app : { | |
server : "http://backbonetraining.bocoup.com:8000" | |
}, | |
// application data | |
data : { | |
// station collection | |
lines : null |
OlderNewer