Skip to content

Instantly share code, notes, and snippets.

View branch14's full-sized avatar

Phil Hofmann branch14

View GitHub Profile
@dcj
dcj / pg.clj
Created October 12, 2020 23:44
Coercing between Clojure and Postgres/PostGIS
(ns coerce.jdbc.pg
(:require
[clojure.string :as string]
[java-time :as time]
[next.jdbc :as jdbc]
[next.jdbc.connection :as connection]
[next.jdbc.result-set :as result-set]
[next.jdbc.prepare :as prepare]
[geo.io]
[cheshire.core :as json]
@maxweber
maxweber / query_check.clj
Created May 13, 2016 16:41
Checks if a Datomic datalog query contains only allowed symbols / functions.
(require '[datomic.api :as d]
'[clojure.string :as str])
(defn normalize-query
"Turns a vector formatted Datomic datalog query into a map formatted
one."
[query]
(let [pairs (partition-by keyword? query)]
(assert (even? (count pairs)))
(into
@boennemann
boennemann / README.md
Last active March 30, 2021 23:00
Pushing new releases of a legacy version with semantic-release

If you have a package where a lot of people are still using a legacy version of it you might want to keep pushing (security-)fixes to that "branch".

Let's say the "latest" version of your package is "5.4.0", but there is as significant amount of people still using "4.7.4" – the last version you released before doing "5.0.0".

You found a critical bug in "5.4.0" and push it as out as "5.4.1", but it applies to "4.7.4" as well and so you want to do "4.7.5".

Assuming you have semantic-release already set up, you can follow these steps to get that "4.7.5" legacy support release out.

  1. Go to the relevant commit: git checkout v4.7.4
  2. Create a new branch from it: git checkout -b 4.x (You can choose any branch name, just make sure to use the same in step 3)
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 12, 2024 11:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@msgodf
msgodf / rickshaw-full-demo.cljs
Created January 18, 2014 20:26
Full Rickshaw Example in Clojurescript
;; Original example (in Javascript) at: http://code.shutterstock.com/rickshaw/examples/lines.html
(def graph-with-legend
(let [series-data (array (array) (array) (array))
random (Rickshaw.Fixtures.RandomData. 150)]
(dotimes [i 150]
(.addData random series-data))
(doto
(Rickshaw.Graph. (clj->js {:element (.getElementById js/document "chart")
:renderer "line"
:width 960
@ganta
ganta / production.rb
Created July 8, 2012 11:37
Unicorn init.d script with support for different rbenv gemsets
# RAILS_ROOT/config/unicorn.rb
# Search for "# SET ME!" and replace these with your own settings!.
HOW_DEEP_WE_R_FROM_RAILS_ROOT = "../.."
# Set environment to development unless something else is specified
RAILS_ROOT = File.expand_path(HOW_DEEP_WE_R_FROM_RAILS_ROOT, File.dirname(__FILE__))
SHARED_PATH = File.expand_path('../shared', RAILS_ROOT)
ENV['BUNDLE_GEMFILE'] = File.expand_path("#{HOW_DEEP_WE_R_FROM_RAILS_ROOT}/Gemfile", File.dirname(__FILE__))