Skip to content

Instantly share code, notes, and snippets.

Isaac Sanders isaacsanders

Block or report user

Report or block isaacsanders

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Promoting images with Docker & OpenShift

You need to have the oc command installed to interact with OpenShift from the command line. This can be installed from Docker is also required. Search online for information on how to do that.

These are the commands to ensure your system state is such that you can perform an image promotion between staging and production.

View output.log
** (Mix) httpc request failed with: :socket_closed_remotely
Could not install Hex because Mix could not download metadata at
10:05:53.111 [error] Failed updating session:
ProfileName: :httpc_mix
SessionId: {{'', 443}, #PID<0.111.0>}
Pos: 7
Value: 0

Thread 1: main (WAITING)

sun.misc.Unsafe.park(Native Method)
spark-submit \
--class org.alitouka.spark.dbscan.exploratoryAnalysis.DistanceToNearestNeighborDriver \
--master yarn \
--deploy-mode cluster \
--driver-cores 4 \
--num-executors 10 \
--executor-memory 8g \
--executor-cores 4 \
--conf spark.yarn.executor.memoryOverhead=1024 \
isaacsanders / subclass_include.rb
Last active Aug 29, 2015
Ruby Subclassing and Including
View subclass_include.rb
module Foo
def self.included base
puts "Included by #{base}"
class Bar
include Foo
def self.inherited(base)
isaacsanders /
Last active Aug 29, 2015
Emacs Clojure Commands

CIDER Commands

C-c +

  • M-j: Jack into an nREPL session and open a REPL buffer.
  • M-n: Switch REPL to the current buffer's namespace.
  • C-z: Open REPL and move cursor to REPL.
  • C-o: Clear the last line's output.
  • M-o: Clear all the output
View function.rb
def function(a)
a.group_by.inject({}) do |hash, (key,val)|
hash[key] = val.count if val.count > 1
View facebook_bootstrap_template.rb
ruby_version = ask("What ruby version is your app?")
ruby_gemset = ask("What do you want to name your gemset?")
file(".ruby-version", ruby_version)
file(".ruby-gemset", ruby_gemset)
gem 'haml-rails'
gem 'bootstrap-sass'
View output.log
Resetting stock for product 22 to 104 units.
(1 row(s) affected)
Removing order (OrderID=11077, ProductID=22).
(1 row(s) affected)
Adding order to Order Details table for 50 units of product 22.
(1 row(s) affected)
View id3.clj
(defn build-id3-tree
"Builds an ID3 Decision tree to find target-attr based on the examples"
[examples target-attr attributes]
(same? target-attr examples) { :label (target-attr (first examples)) }
(empty? attributes) { :label (most-common target-attr examples) }
:else (let [attr (max-val #(information-gain % examples) attributes)
groups (group-by attr examples)
child-agent (agent {})]
(loop [[value subset] (first groups)
You can’t perform that action at this time.