Skip to content

Instantly share code, notes, and snippets.

View also's full-sized avatar

Ryan Berdeen also

View GitHub Profile
air:vmware ryan$ vagrant init precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
air:vmware ryan$ vagrant up --provider vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
[default] Cloning VMware VM: 'precise64'. This can take some time...
[default] Verifying vmnet devices are healthy...
[default] Preparing network adapters...
wget -qO- https://get.docker.io/gpg | apt-key add -
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y lxc-docker
@also
also / gist:7729708
Last active June 1, 2021 09:02
how does /usr/libexec/java_home work?
# /usr/libexec/java_home -X
$ sudo opensnoop -n java_home
UID PID COMM FD PATH
501 79809 java_home 3 /System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching
501 79809 java_home 3 /dev/dtracehelper
501 79809 java_home 4 /System/Library/CoreServices/SystemVersion.bundle//English.lproj
501 79809 java_home -1 /System/Library/CoreServices/SystemVersion.bundle//Base.lproj
501 79809 java_home 4 /System/Library/CoreServices/SystemVersion.bundle/English.lproj/SystemVersion.strings
501 79809 java_home -1 /System/Library/CoreServices/SystemVersion.bundle/English.lproj/SystemVersion.stringsdict
501 79809 java_home 3 /usr/share/icu/icudt51l.dat
@also
also / java-6.diff
Created November 30, 2013 18:50
closure-compiler java 6 support
From cf03c8a20ef3f2d90f8218ec503e2bbd302bb2b8 Mon Sep 17 00:00:00 2001
From: Ryan Berdeen <[email protected]>
Date: Sat, 30 Nov 2013 13:46:27 -0500
Subject: [PATCH] java 6 support
---
build.xml | 8 ++++----
.../google/javascript/jscomp/ProcessClosurePrimitives.java | 11 +++++++++--
2 files changed, 13 insertions(+), 6 deletions(-)
@also
also / kafka.clj
Created November 8, 2013 04:58
riemann kafka transport
(ns riemann.transport.kafka
(:import java.util.concurrent.Executors
java.util.Properties
kafka.consumer.Consumer
kafka.consumer.ConsumerConfig
kafka.javaapi.consumer.ConsumerConnector)
(:use [riemann.service :only [Service ServiceEquiv]]))
(defn- consumer-properties
[opts]
@also
also / simple_checks.coffee
Last active December 27, 2015 10:39
calling simple-check generators from node.js/coffeescript
# https://github.com/also/simple-check/tree/cljx
goo = require './goog' # https://gist.github.com/also/7189192
goog = goo 'target/unoptimized/goog'
goog.load 'target/unoptimized.js'
cljs = goog.require 'cljs.core'
gen = goog.require 'simple_check.generators'
console.log cljs.clj__GT_js gen.sample gen.int$
console.log cljs.clj__GT_js gen.sample gen.vector gen.string_ascii
@also
also / README.md
Last active December 26, 2015 17:48

This lives in the npm module oog (https://npmjs.org/package/oog).

Running the ClojureScript Hello World example in node.js without creating a goog global.

$ cljsc hello.cljs > hello.js
$ coffee test.coffee
Hello node.js
exposed_scope = {}
top_scope = null
push_scope = ->
top_scope = exposed_scope.__proto__ = Object.create exposed_scope.__proto__
pop_scope = ->
top_scope = exposed_scope.__proto__ = exposed_scope.__proto__.__proto__
with_scope = (fn) ->
fs = require 'fs'
_ = require 'underscore'
lead = require './dist/nodejs/node.js'
parser = lead.require 'graphite_parser'
dsl = lead.require 'dsl'
filename = process.argv[2]
s = fs.readFileSync filename, 'ascii'