Skip to content

Instantly share code, notes, and snippets.

(ironman) ~/projects/personal $ sudo npm build apricot
npm it worked if it ends with ok
npm configfile /Users/ironman/.npmrc
npm cli [ 'build', 'apricot' ]
npm version 0.1.20
npm required jsdom->= 0.0.1
npm found jsdom@0.0.1
npm createMain ./lib/apricot
npm linkLib apricot-0.0.1
npm ! WARNING !
// Fails
main = document.getElementById("main");
var div = document.createElement('DIV');
div.innerHTML = "<body>This is BODY2</body>";
main.appendChild(div);
// Works
main = document.getElementById("main");
var div = document.createElement('DIV');
var body = document.createElement('BODY');
var templateData = this.responseText;
var data = {
person: {
name : {
first : 'Rob',
last : 'Ellis'
},
age: 30,
location : {
@silentrob
silentrob / stream_mp4
Created April 8, 2011 04:45
Connect Stream mp4 Example
require('connect').createServer(
connect.static(__dirname + '/videos', { maxAge: 0 }),
function(req, res) {
res.setHeader('Content-Type', 'text/html');
res.end('<video width="300px" src="/OLD_BOY.mp4" controls="controls" autoplay="autoplay"></video>');
}
).listen(process.env.PORT || 4000);
@silentrob
silentrob / ex1data.txt
Created November 9, 2011 07:28
Using Sylvester to run gradient decent in Node.
6.1101,17.592
5.5277,9.1302
8.5186,13.662
7.0032,11.854
5.8598,6.8233
8.3829,11.886
7.4764,4.3483
8.5781,12
6.4862,6.5987
5.0546,3.8166
@silentrob
silentrob / gist:1371921
Created November 16, 2011 23:57
Simple Node static Server
#!/usr/bin/env node
var express = require("/Users/ironman/.node_libraries/express");
var startPort = 4567;
var app = express.createServer();
app.configure(function(){
app.use(express.static(process.cwd() + '/'));
app.use(express.directory(process.cwd() + '/',{ icons:true }));
@silentrob
silentrob / package.json
Created May 20, 2012 23:56
Plex + CP + Trakt Trending Updater
{
"author": "Rob Ellis <rob@silentrob.me>",
"name":"trakt_trending",
"version" : "0.0.1",
"dependencies": {
"request" : "2.9.202",
"xml2js": "*"
}
}
@silentrob
silentrob / gist:2897913
Created June 8, 2012 20:08
Broken code.
FMWK.button = function() {
  var _this = this;
this.el = document.createElement('button');
  ['hide','show'].forEach(function(method){
    FMWK.button.prototype[method] = function(){
      $(_this.el)[method].apply($(_this.el), Array.prototype.slice.call(arguments));
     }
  });
return this;
@silentrob
silentrob / gist:3147818
Created July 20, 2012 00:10
Scroll to position
$('.btt a[href*=#]').bind("click", $.NS.navigationJump);
$.NS = function(){
$(document).ready(function(){
try {
if(location.hash.length > 0){
var target = location.hash.split('/')[1];
var of = (target == "header") ? 0 : 350;
$('html, body').animate({scrollTop: $('#'+target).offset().top + of}, 500);
$('.nav a[href=#'+target+']').addClass('active');
@silentrob
silentrob / gist:3184161
Created July 26, 2012 19:58
NPL Bookmarks Links
http://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
http://code.google.com/p/nltk/source/browse/trunk/nltk
http://wordnet.princeton.edu/wordnet/download/
http://code.google.com/p/nltk/source/browse/trunk/nltk/nltk/chunk/named_entity.py
http://www.writingcentre.uottawa.ca/hypergrammar/subjpred.html
http://nlp.stanford.edu/software/crf-faq.shtml
http://sourceforge.net/apps/mediawiki/opennlp/index.php?title=Name_Finder
http://en.wikipedia.org/wiki/Sentiment_analysis
http://arxiv.org/pdf/cs.LG/0212032
http://www.scribd.com/doc/7865458/the-learning-chatbot