Skip to content

Instantly share code, notes, and snippets.

View kumavis's full-sized avatar
🐉
!

kumavis kumavis

🐉
!
View GitHub Profile
@kumavis
kumavis / gist:5681818
Created May 30, 2013 22:38
browserify dependencies
[kumavis:...opment/Node/node-browserify]$ npm list                                                                          
npm WARN unmet dependency /Users/kumavis/Dropbox/Development/Node/node-browserify/node_modules/tap/node_modules/glob requires inherits@'1' but will load
npm WARN unmet dependency /Users/kumavis/Dropbox/Development/Node/node-browserify/node_modules/tap/node_modules/inherits,
npm WARN unmet dependency which is version 2.0.0
browserify@2.17.2 /Users/kumavis/Dropbox/Development/Node/node-browserify
├─┬ backbone@0.9.10
│ └── underscore@1.4.4
├─┬ browser-pack@0.9.1
│ ├─┬ combine-source-map@0.1.2
@kumavis
kumavis / gist:5691536
Last active December 17, 2015 23:48
browser-resolve 1.0.1 fails to locate package.json

from browser-resolve 1.0.1 index.js

// paths is mutated
// load shims from first package.json file found
function load_shims(paths, cb) {
    // identify if our file should be replaced per the browser field
    // original filename|id -> replacement
    var shims = {};

 (function next() {
@kumavis
kumavis / gist:5703360
Last active December 18, 2015 01:19
Notes for making "black_magic" for node-browserify

any node package in the browser

browserify makes this possible for many modules, but the browser is a different environment (ex: no file system access) so we're going to need a few things if we want to run just anything:

1- browser versions of the native modules

  • many are detailed here
@kumavis
kumavis / gist:5703920
Last active December 18, 2015 01:29
An attempt at browserifying npm

This project:

  1. is a case-study for browserifying anything
  2. part of a dream to create virtual Node.js development environment
  3. likely a major time-sink!

starting out:

mkdir browser-npm && cd browser-npm
npm install npm
@kumavis
kumavis / dns.js
Created June 4, 2013 07:57
This is just a copy-pasta piece of junk, I have not tested it.
// ===========================================================
// ===========================================================
// THIS IS COPY-PASTE-HACK. THIS IS NOT KNOWN TO ACTUALLY WORK
// ===========================================================
// ===========================================================
module.exports = {
lookup: function (domain, family, callback) {
// parse arguments
if (arguments.length === 2) {
@kumavis
kumavis / constants.js
Created June 4, 2013 08:03
This is just copy-pasta.
module.exports = {
O_RDONLY: 0,
O_WRONLY: 1,
O_RDWR: 2,
S_IFMT: 61440,
S_IFREG: 32768,
S_IFDIR: 16384,
S_IFCHR: 8192,
S_IFBLK: 24576,
S_IFIFO: 4096,
[response cut]
,"abc-gruntfile-helper":{"name":"abc-gruntfile-helper","description":"Helpers to easier the configuration of gruntfile for ABC","dist-tags":{"latest":"0.0.1"}
,"maintainers":[{"name":"neekey","email":"ni184775761@gmail.com"}
],"author":{"name":"neekey","email":"ni184775761@gmail.com"}
,"repository":{"type":"git","url":"https://github.com/neekey/abc-gruntfile-helper"}
,"time":{"modified":"2013-04-27T09:26:20.701Z"}
,"versions":{"0.0.1":"latest"}
,"keywords":["abc gruntfile helper kissypie"]}
,"abc-tpl-kissypie":{"name":"abc-tpl-kissypie","description":"ABC推荐目录.","dist-tags":{"latest":"0.0.1"}
@kumavis
kumavis / gist:5732958
Created June 7, 2013 22:51
Actual browserified npm console output. Not a dramatization.
NAME DESCRIPTION AUTHOR DATE VERSION KEYWORDS
atlaspack Pack rectangles (or images) into a rectangle (or canvas texture atlas). =shama 2013-04-25 22:30 0.2.4 voxel texture atlas geometry spritemap
craft An HTML5 crafting API. =shama 2013-05-07 16:23 0.1.0 voxel crafting minecraft
greedy-mesher Greedy mesh compiler =mikolalysenko 2013-06-02 19:20 0.0.0 greedy mesh compiler voxel geometry ndarray
isosurface 3D isosurface polygonizer =mikolalysenko 2013-02-11 19:03 0.1.0 voxel isosurface level set 0fps surface nets marching cubes tetrahedra
minecraft-chunk read voxel data from minecraft chunks =maxogden 2013-04-22 07:22 0.3.0
mineflayer-voxel A plugin to give you a web-based view of your mineflay
@kumavis
kumavis / gist:5789583
Created June 15, 2013 21:04
Process not exiting, emitting whitespace
class NugBug
{
public static void Help() {
int timeout = 5000;
using (Process process = new Process())
{
process.StartInfo.FileName = "mono";
process.StartInfo.Arguments = "--runtime=v4.0 /usr/local/bin/NuGet.exe help";
[0xac0e2a28: 1.58671 8] ENTER: NuGet.Common.Console:get_CursorLeft ()(this:0x568f70[NuGet.Common.Console NuGet.exe], )
[0xac0e2a28: 1.58673 8] LEAVE: NuGet.Common.Console:get_CursorLeft ()result=0
[0xac0e2a28: 1.58674 8] ENTER: NuGet.Common.Console:get_Out ()(this:0x568f70[NuGet.Common.Console NuGet.exe], )
[0xac0e2a28: 1.58675 8] LEAVE: NuGet.Common.Console:get_Out ()[System.IO.SynchronizedWriter:0x5ddfc0]
[0xac0e2a28: 1.58678 8] ENTER: NuGet.Common.Console:get_CursorLeft ()(this:0x568f70[NuGet.Common.Console NuGet.exe], )
[0xac0e2a28: 1.58679 8] LEAVE: NuGet.Common.Console:get_CursorLeft ()result=0
[0xac0e2a28: 1.58681 8] ENTER: NuGet.Common.Console:get_Out ()(this:0x568f70[NuGet.Common.Console NuGet.exe], )
[0xac0e2a28: 1.58682 8] LEAVE: NuGet.Common.Console:get_Out ()[System.IO.SynchronizedWriter:0x5ddfc0]