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
# GVIM Wrapper! | |
# Usage: gvim [option] [file...] open files, tabbed, in a shared window (default one per terminal) | |
# Options: (only one can be used) | |
# -d, --dir Open files in a window specific to the current working directory | |
# -n, --normal Execute command without server arguments | |
# -s, --server <name> Open files in the window named <name> | |
# --print Print command with full arguments | |
# --usage Print this message and exit | |
vim-gui-server() { | |
local PROGRAM="$1" |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2267151/hack.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
// src/main.c | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <libspotify/api.h> | |
#define DEBUG 1 | |
extern const uint8_t g_appkey[]; | |
extern const size_t g_appkey_size; |
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 Readable = require('stream').Readable; | |
var r = new Readable({ | |
lowWaterMark: 3, | |
highWaterMark: 10 | |
}); | |
var calls = 0; | |
r._read = function (n, cb) { | |
console.log("_read", this._readableState.length, | |
this._readableState.lowWaterMark, | |
this._readableState.highWaterMark) |
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 AsyncCache = require('async-cache') | |
var fs = require('fs') | |
var stats = new AsyncCache({ | |
max: 100, | |
maxAge: 1000, | |
load: function (filePath, cb) { | |
fs.stat(filePath, cb); | |
} | |
}) |
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 createGame = require('voxel-engine') | |
function sphereWorld(x, y,z ) { | |
// return the number of the material you want to show up | |
// at the current x, y, z position. | |
// the numbers refer to the games materials array. | |
// 0 is air | |
if (x*x + y*y + z*z > 15*15) return 0 | |
// 3 is dirt | |
return 3 |
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 shoe = require('shoe') | |
, fetch = require('git-fetch-pack') | |
, unpack = require('git-list-pack') | |
, through = require('through') | |
, Buffer = require('buffer').Buffer | |
// make a websocket connection to the | |
// server. | |
var conn = shoe('/git') | |
, client |
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
$('body').append([ | |
"<div class='loading-screen' style='z-index:1005'>", | |
"<div class='loading-container'>", | |
"<div class='text'>Loading " + item.name + " (" + item.id + ")", | |
"<div class='progress progress-striped active' style='width: 100%'>", | |
<div class='bar' style='width: 100%;'></div>", | |
"</div>", | |
"</div>", | |
"</div>", | |
"</div>" |
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
;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){ | |
// your code | |
},{}]},{},[1]) | |
; |
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
# simple bundle | |
$ time browserify --debug lib/boot/index.js | wc -c | |
1397809 | |
real 0m1.726s | |
user 0m1.540s | |
sys 0m0.139s | |
# bundle without node_modules |
OlderNewer