Skip to content

Instantly share code, notes, and snippets.

View chakrit's full-sized avatar

Chakrit Wichian chakrit

View GitHub Profile
# nvmcp $old_version
#
# Copy all globally-installed npm packages from $old_version to `default` version.
# Had to roll this since nvm copy-packages doesn't quite work.
nvmcp () {
nvm use $1
npm ls -g --parseable 2> /dev/null \
| grep -E "node_modules" \
| grep -Ev "node_modules.+node_modules" \
| sed -Ele "s/^.+node_modules\/(.+)/\\1/g" \
[12/23 14:39:58 GMT+0700] ld.so.1: node: fatal: relocation error:
file /opt/haibu/apps/chakrit/bicycle/package/node_modules/pg/build/Release/binding.node:
symbol PQconnectStart: referenced symbol not found
wordsplit.node:
@rpath/wordsplit.node (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/usr/local/lib/libicui18n.50.1.dylib (compatibility version 50.0.0, current version 50.1.0)
/usr/local/lib/libicuuc.50.1.dylib (compatibility version 50.0.0, current version 50.1.0)
/usr/local/lib/libicudata.50.1.dylib (compatibility version 50.0.0, current version 50.1.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0)
-I/usr/local/Cellar/icu4c/50.1/include
#include <stdio.h>
#include <unistd.h>
const int S2uS = 1000000;
int
main() {
for (int i = 0; i < 5; i++) {
fprintf(stdout, "HELLO - %d\r\n", i);
var logMe = function(args) { logMe.args = arguments; };
logMe.reset = function() { logMe.args = null; };
module.exports = logMe;
// Generated by CoffeeScript 1.3.3
(function() {
var Base, Child,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Base = (function(_super) {
__extends(Base, _super);
Pod::Spec.new do |s|
s.name = 'BlocksKit+NSOrderedSet'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'The NSOrderedSet block utilities you always wish you had.'
s.homepage = 'https://github.com/zwaldowski/BlocksKit'
s.author = { 'Zachary Waldowski' => '[email protected]' }
s.source = { :git => 'git://gist.github.com/1959168.git', :tag => 'origin/master' }
s.source_files = '*.{h,m}'
s.dependency 'BlocksKit'
//
// ATInterceptor.h
// AddressTalk
//
// Created by Chakrit Wichian on 4/25/12.
// Copyright (c) 2012 Oozou Ltd. All rights reserved.
//
// ----
//
// Receives and relays any messages sent to it to the middleman if the
var originalFunc = object.func;
object.func = function() {
// custom code here
// call original function
originalFunc.apply(this, arguments);
};