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
require('coffee-script') | |
require('./index') |
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
class MoreableCollection extends RocketCollection | |
more: (options)-> | |
collection = @ | |
collection.page or= 1 | |
collection.page++ | |
moreUrl = "#{@url}?page=#{collection.page}" | |
$.getJSON moreUrl, (data) -> collection.add 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
<div id="blackbox-web-debug"> | |
| |
<a href="javascript:WpDebugBar.switchPanel('globals')" class="globals">Globals</a> | |
<a href="javascript:WpDebugBar.switchPanel('profiler')" class="profiler">Profiler (535.58 ms)</a> | |
<a href="javascript:WpDebugBar.switchPanel('database')" class="database">SQL (296 queries in 31.42 ms)</a> | |
<a href="javascript:WpDebugBar.switchPanel('errors')" class="errors">Errors (27)</a> | |
<a href="javascript:WpDebugBar.close()" class="close">Close Toolbar</a> | |
<div id="blackbox-globals" class="debug-panel"> | |
<pre><code class="php"><span class="variable">$_GET</span> = <span class="keyword">array</span> ( |
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 sayHello = function(name, callback) { | |
callback("Hello " + name); | |
} | |
sayHello('Dan Williams', function(helloString){ | |
console.log(helloString); | |
}); |
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
function anonymous(locals, attrs, escape, rethrow) { | |
var buf = []; | |
with (locals || {}) { | |
var interp; | |
buf.push('\n<p>Hello ' + escape((interp = name) == null ? '' : interp) + '\n</p>'); | |
} | |
return buf.join(""); | |
} |
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
dateFromArray = (dateArr) -> | |
[year, month, day , hour, minute, second, millisecond] = dateArr | |
new Date year, month || 0, day || 0, minute || 0, second || 0, millisecond || 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
<?php | |
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { | |
// Avoid "not found" errors for favicon, which is automatically requested by most browsers. | |
} else { | |
... | |
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
upstream backend { | |
server unix:/tmp/sweet.sock; | |
} |
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 controller = { | |
edit: function(req, res) { | |
}, | |
update: function(req, res) { | |
req.model.save(function(err) { | |
if(err) { | |
controller.edit(req, res) | |
} | |
... |
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
// Using machine learning to determine where people live. | |
var brain = require('brain'); | |
var bayes = new brain.BayesianClassifier(); | |
// Training the Machine about Toronto | |
bayes.train("Toronto, On", "Toronto"); | |
bayes.train("Greater Toronto Area, Ontario", "Toronto"); |