Skip to content

Instantly share code, notes, and snippets.

@realgenekim
realgenekim / README-vega-arc-diagram.md
Last active Feb 29, 2020
Here's a basic skeleton of how to create a Vega arc diagram
View README-vega-arc-diagram.md

Vega-lite is awesome and graphs are easy to create.

Vega is... wow... you've got to write a lot more JSON to generate a graph.

Here is a skeleton Vega Arc diagram that you can use to create your own -- I couldn't find one on the internet, and it took me nearly six hours to figure out how to create one.

Enjoy! Gene

View trello_interfaces.cljs
(ns trello-workflow.trello-interfaces
(:require [re-frame.core :as re-frame]
[ajax.core :as ajax]
[trello-workflow.io :as io]
[goog.string :as gstring]
[goog.string.format]))
(defprotocol TrelloInterface
" interface to loading boards, lists, cards
{:command :load-board
View oz-demos.clj
(ns analyze.oz
(:require [oz.core :as oz]
[clojure.data.json :as json]))
#_ (oz/start-plot-server!)
(defn group-data [& names]
(apply concat (for [n names]
(map-indexed (fn [i x]
@realgenekim
realgenekim / firebase.clj
Last active Aug 28, 2020
attempt to get Google Cloud Firestore working in Clojure
View firebase.clj
(ns firebase1.core
(:require [clojure.java.io :as io]
[clojure.core.async :as async]
[clojure.reflect :as r])
(:import (com.google.auth.oauth2 GoogleCredentials)
(com.google.firebase FirebaseOptions$Builder)
(com.google.firebase FirebaseApp)
(com.google.cloud.firestore.v1beta1 FirestoreClient))
(:gen-class))
@realgenekim
realgenekim / project.clj
Created Sep 5, 2018
attempt to get multiple entry points running using figwheel.main
View project.clj
(defproject trello-workflow "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.339"]
;[org.clojure/clojurescript "1.9.946"]
[org.clojure/core.async "LATEST"]
[org.clojure/test.check "0.10.0-alpha2"]
[reagent "0.7.0"]
[re-frame "0.10.5"]
[day8.re-frame/http-fx "0.1.6"]
[secretary "1.2.3"]
View Ibid.hs
-- Build this with "ghc ibid.hs"
-- Test it with "./ibid"
-- Import some list functions
import Data.List
-- Some refs to test on
refs = ["book1","book2","ibid","ibid","paper1","ibid","paper2","book3"]
-- Code close to what John wrote that will work in ghci
View Ibid.cljs
(def in ["a" "ibid" "ibid" "b"])
(defn ibid
([in]
(ibid (vec (first in)) (rest in))
([left right]
(println left right)
(if (empty? right)
; done
left
@realgenekim
realgenekim / ghostwheel-config.cljc
Last active Oct 9, 2018
My starting point for ghostwheel type checking
View ghostwheel-config.cljc
(ns bookserver.io
#:ghostwheel.core{:trace true
:check false
:num-tests 0
; oustrument to check types at run-time for all functions
; in this namespace
:outstrument true}
(:require [clojure.spec.alpha :as s]
[ghostwheel.core :as g
View jsondemo.cljs
; I mostly use Clojure running on the JVM, and ClojureScript that compiles into
; JavaScript that runs in browser
;
; But there are two great ClojureScripts that feel more like scripting.
; - Lumo runs on top of Node.js and can therefore use npm libraries
; https://github.com/anmonteiro/lumo
; - Planck runs on JavaScriptCore which powers Safari (I think)
; https://github.com/planck-repl/planck
;
; I chose lumo because the first Google result "clojurescript parse json"
View rungketest.sh
#!/bin/bash
#
# Posting this as an example of a bash script I never should have written:
#
# it runs inside of a CI pipeline, waits for a kubernetes job to complete, looping
# until kubectl reports the job finishing, either success or fail.
#
# The problem: parsing the output frm kubectl is something I've used in a bunch of scripts,
# including exec'ing a shell, killing a pod, listing pods...
You can’t perform that action at this time.