Micheil Smith miksago

View gist:4189755
1 2 3 4 5 6 7 8 9 10
$(function(){
function getText(el){
return $(el).text().trim();
}
 
function formatDate(str){
return new Date(str + " 2012");
}
 
function formatNumber(n) {
View gist:4026722
1 2 3 4 5 6 7 8 9 10
function ArrayForEach(iteratee, f, receiver) {
if ((iteratee == null)) {
throw new Error("called_on_null_or_undefined");
}
 
if (typeof f !== "Function") {
throw new Error('called_non_callable');
}
// Pull out the length so that modifications to the length in the
// loop will not affect the looping.
View gist:3923587
1 2 3 4 5 6 7 8 9 10
var EventEmitter = require("events").EventEmitter;
var util = require("util");
 
function AtCommand(type, number, args) {
this.type = type;
this.number = number;
this.args = args;
}
 
exports.AtCommand = AtCommand;
View gist:3287691
1 2 3 4 5 6 7 8 9 10
{
"created_at": "Tue Aug 07 17:29:47 +0000 2012",
"id": 232891301639622660,
"id_str": "232891301639622658",
"text": "Ha, @miksago did @TechWraith make you send that Tweet?",
"source": "<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
View gist:3183185
1 2 3 4 5 6 7 8 9 10
> curl -v clam.local:10240
* About to connect() to clam.local port 10240 (#0)
* Trying 192.168.3.136... connected
* Connected to clam.local (192.168.3.136) port 10240 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: clam.local:10240
> Accept: */*
>
< HTTP/1.1 200 OK
View gist:3183145
1 2 3 4 5 6
require('http').createServer(function(request, response) {
   response.writeHead(200, { "Connection": "keep-alive", "Transfer-Encoding": "chunked", "Content-Type": "text/html" });
   response.write('Hello');
   response.write('Hello');
   response.end('Hello');
}).listen(10240);
View requireDir.js
1 2 3 4 5 6 7 8 9 10
var fs = require('fs');
var Path = require('path');
 
function requireDir(dir){
var modules = {};
 
fs.readdirSync(dir).map(function(name){
return Path.join(dir, name);
}).filter(function(path){
return fs.statSync(path).isFile();
View naf.js
1 2 3 4 5 6 7 8 9 10
// requires raf.js (polyfil)
 
(function(){
var ids = {};
 
function requestId(){
var id;
while (!id || ids.hasOwnProperty(id)){
id = Math.floor(Math.random() * 1E9);
};
View gist:2022961
1 2 3 4 5 6 7 8 9 10
eqm.git npm install -g http-console feature/from-your-network*
npm http GET https://registry.npmjs.org/http-console
npm http 200 https://registry.npmjs.org/http-console
npm http GET https://registry.npmjs.org/http-console/-/http-console-0.6.1.tgz
npm http 200 https://registry.npmjs.org/http-console/-/http-console-0.6.1.tgz
npm http GET https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/eyes
npm WARN eyes@0.1.7 dependencies field should be hash of <name>:<version-range> pairs
npm ERR! error installing http-console@0.6.1
npm ERR! error rolling back http-console@0.6.1 Error: Refusing to delete: /usr/local/bin/http-console not in /usr/local/lib/node_modules/http-console
View gist:1496059
1 2 3 4 5 6 7 8 9 10
var m = sp.require("sp://import/scripts/api/models"),
v = sp.require("sp://import/scripts/api/views"),
dom = sp.require('sp://import/scripts/dom');
 
var someContainer = dom.queryOne('.someClass');
 
m.Album.fromURI("spotify:album:2d7CiSgCNMiSjE9UG3sdTX", function(context){
var player = new v.Player();
player.context = context;
dom.adopt(someContainer, player.node);
Something went wrong with that request. Please try again.