Skip to content

Instantly share code, notes, and snippets.

$ sudo npm publish .
npm it worked if it ends with ok
npm cli [ 'publish', '.' ]
npm version 0.1.26
npm config file /Users/jbr/.npmrc
npm config file /usr/local/etc/npmrc
npm publish [ '.' ]
npm packTar . /Users/jbr/.node_libraries/.npm/.cache/sibilant/0.0.5/package.tgz
npm exec tar "czf" "/Users/jbr/.node_libraries/.npm/.cache/sibilant/0.0.5/package.tgz" "--exclude" ".git" "-X" "/Users/jbr/.node_libraries/.npm/npm/0.1.26/package/lib/utils/default.npmignore" "sibilant"
npm exec tar "xzf" "/Users/jbr/.node_libraries/.npm/.cache/sibilant/0.0.5/package.tgz" "--strip-components=1" "-C" "/Users/jbr/.node_libraries/.npm/.cache/sibilant/0.0.5/package"
(defvar app (send (require 'express) create-server))
(app.get "/" (lambda (req res) (res.send "Hello World")))
(app.listen 8888)
$ make
scons: Reading SConscript files ...
Checking for node.js ...(cached) yes
True
Checking for C++ library xml2... no
Did not find libxml2, exiting!
gmake: *** [node] Error 1
#!/bin/bash
gcc -o src/html_document.o -c\
-I/opt/local/include/libxml2\
-I/opt/local/include\
src/html_document.cc\
-I/usr/nodejs/v0.2.0/include/node/
gcc -o src/html_parser.o -c\
-I/opt/local/include/libxml2\
(setq load-path (cons "~/.emacs.d" load-path))
(setq load-path (cons "~/.emacs.d/textmate.el" load-path))
(setq load-path (cons "~/.emacs.d/color-theme-6.6.0" load-path))
(setq load-path (cons "~/.emacs.d/magit" load-path))
(when window-system
(set-default-font
(concat "-apple-Anonymous_Pro-"
"medium-normal-normal-"
@jbr
jbr / google-json-rss-feed-with-jquery.js
Created November 27, 2010 02:53
load an rss feed w/ jquery through google
$(function () { //assuming jquery and an <OL id="blog"></OL>
$.loadRSS = function (url, callbackName, num) {
$(document.body)
.append('<script src="' +
'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=' +
url +
'&callback=' + callbackName + '&num='+num || 10+'">' +
'</script>')
}
@jbr
jbr / 1-doozer.lisp
Created November 28, 2010 10:17
Just a little builder.
; this depends on node-proxy. npm install node-proxy.
; https://github.com/brickysam26/node-proxy
(defvar builder (hash))
(defun builder.add (type &rest remainder)
(defvar tagname type
attributes ""
contents "")
@jbr
jbr / throw-errors.js
Created January 11, 2011 21:27
in response to recent nodejs post
// In response to this idiom
// (code copied from https://groups.google.com/d/topic/nodejs/wzSUdkPICWg/discussion):
mainWindow.menu("File", function(err, file) {
if (err) throw err;
file.openMenu(function(err, menu) {
if (err) throw err;
menu.item("Open", function(err, item) {
if (err) throw err;
item.click(function(err) {
@jbr
jbr / switch.rb
Created February 12, 2011 11:15
ruby 1.9.2 case-like switch
# In response to:
# http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html
# Ruby 1.9.2 has some neat stuff that lets us make a readable
# alternative case statement that calls each method in turn.
# 1.9.2 features used:
# * hashes are ordered in 1.9.2
# * cool JSON-style hash syntax
# * concise lambda syntax
;; ----------clojure beginner question------------
;; Let's say I have a vector of unique values or a
;; set and want to create a map with those as keys
;; and some transformation of them as values.
;; What's the idiomatic way to do this?
;; I'm using the following, but it seems there
;; should be a better way.
(defn build-map [initial-keys map-fn]