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
<html> | |
<head> | |
<title>fibonacci sequence</title> | |
</head> | |
<body> | |
<p>This will output a ton of numbers and might take a while.</p> | |
<div id="output"></div> | |
<script> | |
var o = '0, 1, ', f = 0, s = 1, n = 1, c = 1000; |
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
setInterval(function() { | |
console.log([s = [86400000, 3600000, 60000, 1000]][0].map(function(t) { | |
return ("0" + [(t===s[0] && (remaining = (future - ~~(+new Date()/1000))*1000)), left = ~~(remaining/t), remaining -= left*t][1]).slice(-2); | |
}).join(':')); | |
}, [1000, future = +new Date()/1000 + 100000][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 letters = "apples".split("").sort().join(""), words = ["pale", "ales", "ape", "grape", "pape", "pppp"]; | |
document.writeln("Matching words to: " + letters); | |
for(var i = 0, c = words.length; i < c; i++) { | |
var word = words[i].split("").sort().join(""), status = true, usedChars = []; | |
for(var ii = 0, cc = word.length-1; ii < cc; ii++) var lidx = letters.indexOf(word[ii], ii), idx = usedChars.indexOf(lidx), status = ((idx == -1 && lidx != -1) ? new Boolean(usedChars.push(lidx)) : false); | |
document.writeln(words[i] + " " + status); | |
} |
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 items = { | |
'LJS93K': { | |
pounds: 1300, | |
cost: 10500 | |
}, | |
'J38ZZ9': { | |
pounds: 700, | |
cost: 4750 | |
}, | |
'HJ394L': { |
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 f = 0, s = 1, n = 1, total = 0; | |
while(n < 4000000) { | |
n = (f+s); | |
f = s; | |
s = n; | |
if(!(n % 2)) total += n; | |
} | |
print(total); |
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 links = ["TkPbJIlEXow", | |
"Z4nAUPw8j5s", | |
"H5MtQA5dvrU", | |
"ouNvc6GRwUg", | |
"0VI4HV0pX-o", | |
"h-x0y3o1UwA", | |
"Z4nAUPw8j5s", | |
"MOzQ4Bs916I", | |
"JByDbPn6A1o", | |
"rf2kMnnNROc", |
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
module.exports = function(app) { | |
app.helpers({ | |
getJS: function(key) { | |
var output = ''; | |
app.configure('development', function(){ | |
try { | |
var files = app.set('masher_config').JAVASCRIPT[key]; | |
for(var i = 0, c = files.length; i < c; i++) { | |
var file = files[i].replace('./public', ''); | |
output += '<script src="'+file+'"></script>'; |
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 express = require('express'), | |
app = module.exports = express.createServer(); | |
//Basic-Auth config | |
var auth = require('basic-auth')({ | |
name: 'Test Auth', | |
accounts: [ | |
'test:password', | |
'test2:password2' | |
] |
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(){ | |
//These can be anything you want ;) | |
var images = [ | |
'http://28.media.tumblr.com/ei729ojaFm9ickfnHLmkACuuo1_400.jpg', | |
'http://26.media.tumblr.com/ei729ojaFm9ic7489TiIUBvvo1_400.jpg', | |
'http://26.media.tumblr.com/ei729ojaFm9iasuebHQjetZro1_400.jpg', | |
'http://28.media.tumblr.com/ei729ojaFm9i5f8mO0DHWAu3o1_400.jpg' | |
] | |
//let the trolling begin |
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 NumberInput = Fidel.ViewController.extend({ | |
init: function() { | |
this.el.bind('keyup', this.proxy(this.changeValue)); | |
}, | |
changeValue: function() { | |
var value = ~~(this.el.val()); | |
this.el.val(value); | |
this.trigger('valueChanged', [value]); | |
} | |
}); |
OlderNewer