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
View ocp-promotion.md

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.

View output.log
** (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
View thread_dump.md

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)
View calculate_dnn.sh
#!/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 Aug 29, 2015
Ruby Subclassing and Including
View subclass_include.rb
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 Aug 29, 2015
Emacs Clojure Commands
View emacs-clojure.md

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
hash
end
end
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...
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]
(cond
(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.