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
// To start vlc with telnet remote control: | |
// ./VLC --extraintf rc --rc-host 0.0.0.0:3000 | |
// | |
// To connect to multiple vlc's | |
// node vlcrc.js host1:3000 host2:3000 | |
var net = require('net'); | |
var readline = require('readline'); | |
//addresses of servers |
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 css = 'insert lots of css here'; | |
var files = {}; | |
css = css.replace(/url\((\S*)\.(png|jpg|jpeg|gif)\)/g, function(match, file, type) | |
{ | |
var fileName = file + '.' + type; | |
var size = fs.statSync(fileName).size; | |
if (size > 4096) { | |
console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)'); | |
return match; |
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
// dynamically load sproutcore20 handlebars templates | |
// add this file to the same dir as your data-main js to load a template as a dependency do | |
// | |
// define(['template!template'] function(){ | |
// //do some SproutCore[ing] | |
// }); | |
// | |
// templates should be located in templates folder and have a .handlebars extension | |
// removed partial support {{> partial}} which doesn't work in SC.Handlebars use |
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
// Jake is like Rake for nodejs https://github.com/mde/jake | |
// | |
// Assumes that Jake will be run in the root of the web app with coffee files in /js/ and | |
// a single app.less file in /css/ that can include references to other .less files | |
// | |
//requires | |
var sys = require('util'); | |
var execute = require('child_process').exec; | |
var fs = require('fs'); |
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
// only output the block if the object property exists/is defined | |
// | |
// {{#defined property}} | |
// Property exists | |
// {{/defined}} | |
Handlebars.registerHelper('defined', function(property, block) { | |
return typeof(this[property]) !== 'undefined' ? block(this) : ''; | |
}); |
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 fs = require('fs') | |
var vm = require('vm') | |
var handlebarsjs = fs.readFileSync('path/to/handlebars.js', 'utf8') | |
var emberjs = fs.readFileSync('path/to/ember.js', 'utf8') | |
var templatesDir = 'path/to/template/dir' | |
desc('Compile all .handlebars templates') | |
task({ 'handlebars': [] }, function () { | |
process.stdout.write('Compiling .handlebars templates') |
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
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="iisnode" path="app.js" verb="*" modules="iisnode" /> | |
</handlers> | |
<!-- stop IIS from replacing non 200 response bodies --> | |
<httpErrors existingResponse="PassThrough" /> | |
<!-- send all incoming requests to nodejs --> |
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 winston = require('winston') | |
require('winston-mongodb') | |
// prepare some custom log levels | |
var customLevels = { | |
levels: { | |
debug: 0, | |
info: 1, | |
warning: 2, | |
error: 3 |
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
/// <summary> | |
/// Creates a fast lookup for auto complete lists | |
/// </summary> | |
/// <typeparam name="T">Object type to to lookup</typeparam> | |
public class AutoComplete<T> { | |
private Dictionary<int, List<KeyValuePair<T, int>>> directory = new Dictionary<int, List<KeyValuePair<T, int>>>(); | |
private int minMatchLength; | |
private bool enableSoundexMatching; | |
/// <summary> |
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
/*global phantom:true, console:true, WebPage:true, Date:true*/ | |
(function () { | |
var url, timeout, page, defer; | |
if (phantom.args.length < 1) { | |
console.log("Usage: phantomjs run-mocha.js URL [timeout]"); | |
phantom.exit(); | |
} | |
url = phantom.args[0]; |
OlderNewer