Skip to content

Instantly share code, notes, and snippets.

exports.normalizeArray = function(arr) {
var [final_array, items, item] = [ [], arr.slice(0), null ];
while(items.length){
item = items.shift();
if( (item == undefined) || (item == '') || (item == '.') ){
// do nothing
} else if(item == '..'){
final_array.pop();
} else {
---- HOSTS
GET /hosts/<hostname>
{ owner: "bob", private: "true", committers: ["bob", "fred"] }
GET /hosts/<hostname>/committers
["bob", "fred"]
GET /hosts/<hostname>/owner
["bob"]
set nocp " Use vim defaults, not vi ones
" set dg " Use digraphs
set fo+=r " Auto-format comments while typing
set com-=:% " '%' doesn't start comments
set hls " Highlight search pattern matches
set nojs " Join lines with only one space
set kp= " No external help system
set mps+=<:> " Make % work with <>
set mls=1 " Check one line for modelines
FATAL:/Developer/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand '-' flag!
[BUILD] bin/__divdi3.o
In file included from <command-line>:0:
include/compiler.h:192:1: error: "__weak" redefined
<built-in>: error: this is the location of the previous definition
make: *** [bin/__divdi3.o] Error 1
@konobi
konobi / mylife.set.to.md
Last active December 11, 2015 09:59
Extract from my twitter archive of tracks I've liked.
@konobi
konobi / read_test.js
Created February 7, 2013 03:50
basic streams2 readable example
var util = require("util");
var stream = require("stream");
var ee = require("events").EventEmitter;
var Readable = stream.Readable;
var emitter = new ee();
// basically just to show stuff going from one place to abother
var pushed = ['a', 'b', 'c', 'd', 'e'];
var pulled = [];
[root@build ~/configurator/node_modules/node-ncurses-0.4.1]# node-gyp -d rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp info spawn python
gyp info spawn args [ '/opt/local/lib/node_modules/node-gyp/gyp/gyp',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
/*
The MIT License (MIT)
Copyright (c) 2013 Cloudtone Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@konobi
konobi / index.js.diff
Created July 28, 2013 03:01
update to node-mocked to reflect reality better... uses a kinda hacky method, but should work.
diff --git a/lib/index.js b/lib/index.js
index e3fde1b..5dd58ae 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -22,8 +22,15 @@ module = module.exports = function (mock_path, libs){
var new_path = path;
var foo = libs.filter(function(libname){
- // XXX - this check may not be sufficient =0(
- return path.match(new RegExp(libname+'$'));
[root@wardrobe /usr/ports]# ps aux
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 10 90.0 1.3 0 7016 - RL 11:27PM 630:24.78 [idle]
root 0 61.9 1.3 0 7048 - RLs 11:27PM 337:01.52 [kernel]
root 1 0.0 0.0 9404 144 - ILs 11:27PM 0:00.05 /sbin/init --
root 2 0.0 1.3 0 7016 - DL 11:27PM 0:00.00 [crypto]
root 3 0.0 1.3 0 7016 - DL 11:27PM 0:00.00 [crypto returns]
root 4 0.0 1.3 0 7016 - DL 11:27PM 0:54.64 [pf purge]
root 5 0.0 1.3 0 7016 - DL 11:27PM 0:00.00 [xpt_thrd]
root 6 0.0 1.3 0 7016 - DL 11:27PM 1:37.19 [pagedaemon]