Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Sam Ritchie sritchie

🎯
Focusing
View GitHub Profile
@sritchie
sritchie / shaper_tests.clj
Created Oct 2, 2011 — forked from sorenmacbeth/shaper_tests.clj
the first fact using provided suceeds, but the second using against-background fails
View shaper_tests.clj
(ns ybot.shaper-tests
(:use cascalog.api
ybot.analytics.yb.shaper
[ybot datastores]
[midje sweet cascalog]))
(let [tag-data [["jmblog"
"07409273223006096"
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/2007/02/optimize_your_y.html"
"United States"
View gist:1112505
(defn do-join [root]
(let [common ["!pub" "!datestr" "!country" "!region" "!city" "!kw" "!ref" "!url"]
zeroed ["?pageviews" "?landings" "?new-visits" "?return-visits" "?bounces"]
pv (pageviews root)
lnd (landings root)
nv (new-visits root)
rv (return-visits root)
b (bounces root)]
(<- [?json]
(pv :>> (conj common !!pvs))
View money.clj
(reduce
(fn [[amount-left coins] denom]
(let [{:keys [mod dividend]} (calc-coins amount-left denom)]
(if (pos? dividend)
[mod (assoc coins denom dividend)]
[amount-left coins])))
[amount {}]
denoms)
(fn [[amount {}] 20]
View pallet-vmfest.md
  1. Install VirtualBox on your machine
  2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
  3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
  4. Clone the image to the directory where you want it to be permanently stored: $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
    • This should produce a uuid for your new image. Keep it around
  5. Start VirtualBox (the GUI) and:
    1. Create an new image Linux - Ubuntu (64bit)
    2. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
View pallet-vmfest.txt
1. Install VirtualBox on your machine
2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
4. Clone the image to the directory where you want it to be permanently stored and make it immutable:
* $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
* This should produce a uuid for your new image. Keep it around
* $ VBoxManage modifyhd /path/to/permanent/location/ubuntu-10-10-64bit-server.vdi --type immutable
5. Start VirtualBox (the GUI) and
1. Create an new image Linux - Ubuntu (64bit)
2. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
You can’t perform that action at this time.