Skip to content

Instantly share code, notes, and snippets.

View isaacsanders's full-sized avatar

Isaac Sanders isaacsanders

View GitHub Profile
$ cat ~/bin/git-update-from-origin
#!/usr/bin/env zsh
git pull origin "${$(git symbolic-ref HEAD)#refs/heads/}"

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 https://github.com/openshift/origin. 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.

@isaacsanders
isaacsanders / output.log
Created October 24, 2017 15:10
Hex/Mix Errors
** (Mix) httpc request failed with: :socket_closed_remotely
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.signed.
10:05:53.111 [error] Failed updating session:
ProfileName: :httpc_mix
SessionId: {{'repo.hex.pm', 443}, #PID<0.111.0>}
Pos: 7
Value: 0

Thread 1: main (WAITING)

sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
akka.actor.ActorSystemImpl$TerminationCallbacks.ready(ActorSystem.scala:817)
akka.actor.ActorSystemImpl$TerminationCallbacks.ready(ActorSystem.scala:786)
@isaacsanders
isaacsanders / calculate_dnn.sh
Created January 21, 2016 16:07
Spark Script
#!/bin/sh
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
isaacsanders / subclass_include.rb
Last active August 29, 2015 14:23
Ruby Subclassing and Including
module Foo
def self.included base
puts "Included by #{base}"
end
end
class Bar
include Foo
def self.inherited(base)
@isaacsanders
isaacsanders / emacs-clojure.md
Last active August 29, 2015 14:23
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
def function(a)
a.group_by.inject({}) do |hash, (key,val)|
hash[key] = val.count if val.count > 1
hash
end
end
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'
Resetting...
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)