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
$ 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" |
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
(defvar app (send (require 'express) create-server)) | |
(app.get "/" (lambda (req res) (res.send "Hello World"))) | |
(app.listen 8888) |
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
$ 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 |
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
#!/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\ |
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
(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-" |
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 () { //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>') | |
} |
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
; 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 "") |
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
// 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) { |
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
# 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 |
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
;; ----------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] |