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
/* Trello Node.js Developer Challenge - Solution | |
* | |
* https://trello.com/jobs/developer | |
* | |
* If hash is defined by the following pseudo-code: | |
* | |
* Int64 hash (String s) { | |
* Int64 h = 7 | |
* String letters = "acdegilmnoprstuw" | |
* for(Int32 i = 0; i < s.length; i++) { |
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
// force certain pages to be refreshed every time. mark such pages with | |
// 'data-cache="never"' | |
// | |
jQuery('div').live('pagehide', function(event, ui){ | |
var page = jQuery(event.target); | |
if(page.attr('data-cache') == 'never'){ | |
page.remove(); | |
}; | |
}); |
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
#include "csdl.h" | |
#include "jakesine.h" | |
int jakesine_init (CSOUND *csound, JAKESINE *p) | |
{ | |
p->inc = *p->freq_in * csound->tpidsr; | |
p->phase = *p->phase_in * TWOPI; | |
return OK; | |
} |
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
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
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 lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Sample Form</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script> | |
<script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
<script type="text/javascript"> |
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
# A simple Makefile alternative to using Grunt for your static asset compilation | |
# | |
## Usage | |
# | |
# $ npm install | |
# | |
# And then you can run various commands: | |
# | |
# $ make # compile files that need compiling | |
# $ make clean all # remove target files and recompile from scratch |
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
Tempo-Synced LFO Wobble Bass | |
Jacob Joaquin | |
July 10, 2011 | |
jacobjoaquin@gmail.com | |
csoundblog.com | |
<CsoundSynthesizer> | |
<CsInstruments> | |
sr = 44100 | |
kr = 44100 |
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
""" | |
Beam decoder for tensorflow | |
Sample usage: | |
``` | |
beam_decoder = BeamDecoder(NUM_CLASSES, beam_size=10, max_len=MAX_LEN) | |
_, final_state = tf.nn.seq2seq.rnn_decoder( | |
[beam_decoder.wrap_input(initial_input)] + [None] * (MAX_LEN - 1), |
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
//- polyfills | |
'use strict'; | |
(function (p) { | |
if (!p.matches) p.matches = p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector; | |
})(Element.prototype); | |
if (typeof window.CustomEvent !== 'function') { | |
window.CustomEvent = function (name, p) { | |
p = p || {}; |
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
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
OlderNewer