Skip to content

Instantly share code, notes, and snippets.

View dobladez's full-sized avatar

Fernando Dobladez dobladez

View GitHub Profile
dobladez / deepGet.js
Last active January 3, 2016 15:18
In JavaScript: access deep object properties avoiding NPE checks
View deepGet.js
* Provide a cleaner way to access deep object properties avoiding null pointers
* So, instead of doing this:
* var x = (obj && obj.prop && obj.prop[subprop] && obj.prop[subprop][lastprop]) || "default";
* you can do:
* var x = get(obj, "prop", "subprop", subprop, lastprop) || "default";
dobladez / gist:5014457
Created February 22, 2013 16:04
My attempt at deploying lein app to VirtualBox via Pallet
View gist:5014457
(ns coral-deploy.pallet8
"Node defintions"
[pallet.api :as api]
[pallet.configure :as configure]
[pallet.actions :as action]
[pallet.crate.automated-admin-user :as admin-user]
[pallet.compute.vmfest :as vbox]
[ :as java]
[pallet.crate.lein :as lein]
dobladez / gist:4998935
Last active December 14, 2015 00:29
Babysteps trying to get started with Pallet and VirtualBox
View gist:4998935
;;; My project.clj:
(defproject projectname "0.1.0-SNAPSHOT"
  :description "FIXME Pallet project for projectname"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.cloudhoist/pallet "0.7.3"]
                 [org.cloudhoist/pallet-jclouds "1.4.3"]
                 [org.cloudhoist/pallet-vmfest "0.3.0-alpha.2"]
                 [org.virtualbox/vboxjws "4.2.6"]