- GitHub Staff
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
watch = require('watch'); | |
fs = require('fs'); | |
var cmd = require('child_process').spawn('cmd'), myArgs; | |
console.log('watcher started'); | |
myArgs = process.argv.slice(2); | |
myDir = myArgs[0]; | |
outDir = myArgs[1] || ''; | |
outDir = stripTrailingSlash(outDir); |
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 domready = require('domready') | |
, bean = require('bean') // events | |
, bonzo = require('bonzo') // DOM wrapper/manipulation | |
, request = require('superagent/superagent') | |
, qwery = require('qwery') // css selectors | |
, slice = Array.prototype.slice; | |
// Attach events API to the prototype of DOM wrapper: | |
var aug = {}; | |
['on', 'off', 'one', 'add', 'fire', 'clone'].forEach(function (k) { |
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
describe( "Video model", function(){ | |
var MOCK_GET_DATA = { | |
channelName: "tgndeveloperedu", | |
commentCount: 0, | |
defaultOrder: 0, | |
dislikeCount: 0, | |
facebookCount: "0", | |
googleCount: "0", | |
likeCount: 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
/*jshint node:true*/ | |
'use strict'; | |
var path = require('path'), | |
url = require('url'), | |
when = require('when'), | |
ffs = require('final-fs'); | |
var reworkRecompile = function (cssPath, reworkPath, doRework) { | |
return ffs.readFile(reworkPath, {encoding: 'utf-8'}) |
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
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus | |
fs = require 'fs' | |
less2stylus = (string) -> | |
string = string | |
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/^(\ *)([^\ \n]+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through) | |
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets |
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
# get template on the fly | |
Handlebars.getTemplate = (name)-> | |
if Handlebars.templates is undefined or Handlebars.templates[name] is undefined | |
$.ajax( | |
url: "/templates/" + name | |
success: (data) -> | |
Handlebars.templates = {} if Handlebars.templates is undefined | |
Handlebars.templates[name] = Handlebars.compile(data) | |
error: (xhr, options, err) -> | |
console.log xhr.status |
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
<script src="ender.min.js"></script> | |
<script> | |
$script('/js/core.min.js', 'core') | |
$script.ready('core', function () { | |
$(document).ready(function () { | |
$('<p>hello world</p>').appendTo('body') | |
.bind('click', function (e) { | |
$script('/js/ajax.min.js', function () { |