Skip to content

Instantly share code, notes, and snippets.

Chris Truter crisptrutski

Block or report user

Report or block crisptrutski

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
@crisptrutski
crisptrutski / kahn.clj
Created Mar 14, 2017 — forked from alandipert/kahn.clj
Kahn's topological sort in Clojure
View kahn.clj
;; Copyright (c) Alan Dipert. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns alandipert.kahn
(:require [clojure.set :refer [difference union intersection]]))
@crisptrutski
crisptrutski / kahn.clj
Last active Mar 14, 2017 — forked from alandipert/kahn.clj
Kahn's topological sort in Clojure
View kahn.clj
;; Copyright (c) Alan Dipert. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns alandipert.kahn
(:require
[clojure.set :refer [union]])
View keybase.md

Keybase proof

I hereby claim:

  • I am crisptrutski on github.
  • I am crisptrutski (https://keybase.io/crisptrutski) on keybase.
  • I have a public key whose fingerprint is F58B C77B 9ECF C9DB 24FE 4832 9CC4 AAF3 BCF9 00F1

To claim this, I am signing this object:

@crisptrutski
crisptrutski / profile.boot
Last active Jan 8, 2016
from-lein extensions
View profile.boot
(def boot-version
(get (boot.App/config) "BOOT_VERSION" "2.5.5"))
(deftask from-lein
"Use project.clj as source of truth as far as possible"
[]
(let [lein-proj (let [l (-> "project.clj" slurp read-string)]
(merge (->> l (drop 3) (partition 2) (map vec) (into {}))
{:project (second l) :version (nth l 2)}))]
(merge-env! :repositories (:repositories lein-proj))
@crisptrutski
crisptrutski / gist:edf29f36a8c89e282c42
Created May 24, 2014
Change project.clj version using sjacket + clojure.walk
View gist:edf29f36a8c89e282c42
(defn form->operation
"Given sjacket nodes for a form, return name of the operation.
Assumes operation is a literal."
[nodes]
(->> nodes
(filter #(= :symbol (:tag %))) first :content
(filter #(= :name (:tag %))) first :content
first))
View list_rack_versions.rb
#!/usr/bin/ruby
files = Dir["reports*"]
files.each do |f|
dir = File.join(`cat #{f}|grep DocumentRoot`.lines.first.split(/\s+/).last.split(/\//)[0..-2])
rails_version = `cd #{dir}; rvm exec bundle list|grep ' rack'`.match(/\(([^)]+)\)/)[1]
deployed_version = `cd #{dir}; cat version`
deployed_branch = `cd #{dir}; cat config/environments/capistrano/#{f.to_s.gsub(/reports_/, '')}.rb|grep :branch`
puts "#{f}: #{rails_version}@#{deployed_version} - #{deployed_branch}"
end
You can’t perform that action at this time.