# Fetch this project.
git clone git://github.com/tbranyen/nodegit.git
# Enter the repository.
cd nodegit
# Installs the template engine, run the code generation script, and build.
npm install
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
/** | |
* Custom Event | |
* | |
* @example | |
* <pre> | |
* function Foo() {} | |
* Foo.prototype.render = function() { | |
* this.trigger('rendered'); | |
* }; | |
* Events.mixin(Foo); |
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 Promise() { | |
this._callbacks = []; | |
} | |
Promise.prototype.then = function(func, context) { | |
var p; | |
if (this._isdone) { | |
p = func.apply(context, this.result); | |
} else { | |
p = new Promise(); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
nw-gyp clean configure build --arch=x64 --target=0.10.5 |
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 crypto = require('crypto'); | |
function md5 (text) { | |
return crypto.createHash('md5').update(text).digest('hex'); | |
}; |
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'), | |
path = require('path'), | |
TianmaCmd = require('./tianma-cmd'), | |
doc = window.document, | |
workdir = doc.getElementById('workdir'), | |
tianma = TianmaCmd(); | |
workdir.addEventListener('change', function(evt) { | |
var dir = this.value, | |
configArr = []; |
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>tianmaGUI</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
document.write('node version:' + process.version); | |
</script> | |
</body> | |
</html> |
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 exec = require('child_process').exec, | |
path = require('path'); | |
var TianmaCmd = function(tianma, cwd) { | |
this.tianma = tianma || path.join(__dirname, '../node_modules/tianma/bin/tianma'); | |
this.cwd = cwd || path.join(__dirname, '../node_modules/tianma/deploy'); | |
}; | |
TianmaCmd.prototype = { | |
_exec: function(cmd, callback) { |
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() { | |
var cache = {}; | |
this.tmpl = function(str, data) { | |
cache[str] = cache[str] || | |
new Function('data', [ | |
'var _p="";\nwith(arguments[0]||{}){\n_p+="', | |
str.replace(/"/g, '\\$&') | |
.replace(/[\r\n]/g, '') | |
.replace(/<%([^\w\s\}\)]*)\s*(.*?)\s*%>/g, function(match, mark, code) { | |
if (mark === '=') return '"+(' + code + ')+"'; |
NewerOlder