Skip to content

Instantly share code, notes, and snippets.

@Folcon
Folcon / keybase.md
Created October 9, 2014 14:01
Keybase Proof

Keybase proof

I hereby claim:

  • I am folcon on github.
  • I am folcon (https://keybase.io/folcon) on keybase.
  • I have a public key whose fingerprint is 02B2 BD89 01C9 B8FA 0284 ED52 06C8 A92E 5296 739B

To claim this, I am signing this object:

@Folcon
Folcon / sample6.txt
Created January 17, 2012 12:24
A Clojure Implementation of the Viterbi Algorithm
======================================
In/IN
[ an/DT Oct./NNP 19/CD review/NN ]
of/IN ``/``
[ The/DT Misanthrope/NN ]
''/'' at/IN
@Folcon
Folcon / Create-Release.ps1
Created April 11, 2013 19:05
Modifications to Create-Release.ps1
[CmdletBinding()]
param (
[Parameter(Position=0, ValueFromPipeLine=$true, Mandatory=$false)]
[string] $ProjectNameToBuild = '',
[Parameter(Mandatory=$false)]
[string] $SolutionDir,
[Parameter(Mandatory=$false)]
[string] $BuildDirectory
)
(ns todo-spec-issue
(:require
[clojure.spec :as s]
[clojure.spec.test :as stest]
[clojure.spec.impl.gen :as gen]))
(s/def ::id int?)
(s/def ::name string?)
(s/def ::todo (s/keys :req-un [::id ::name]))
(s/def ::todos (s/and
@Folcon
Folcon / install-mapnik-amazon-ami.sh
Last active November 20, 2018 19:00 — forked from springmeyer/install-mapnik-amazon-ami.sh
Mapnik on Amazon Linux Default AMI (Fedora)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# Boot up a machine with at least 1.5 to 2 GB Ram
# login
chmod 600 key.pem
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com
# update
@Folcon
Folcon / oz-fails-render.clj
Last active April 27, 2020 16:44
Example from the docs converted and failing to render
This file has been truncated, but you can view the full file.
;; Example from here: https://vega.github.io/vega-lite/docs/repeat.html#multi-series-line-chart-with-repeated-layers
(ns failing-example
(:require [clojure.data.json :as json]
[oz.core :as oz]))
(def data (json/read-str "[{\"Title\":\"The Land Girls\",\"US_Gross\":146083,\"Worldwide_Gross\":146083,\"US_DVD_Sales\":null,\"Production_Budget\":8000000,\"Release_Date\":\"Jun 12 1998\",\"MPAA_Rating\":\"R\",\"Running_Time_min\":null,\"Distributor\":\"Gramercy\",\"Source\":null,\"Major_Genre\":null,\"Creative_Type\":null,\"Director\":null,\"Rotten_Tomatoes_Rating\":null,\"IMDB_Rating\":6.1,\"IMDB_Votes\":1071},{\"Title\":\"First Love, Last Rites\",\"US_Gross\":10876,\"Worldwide_Gross\":10876,\"US_DVD_Sales\":null,\"Production_Budget\":300000,\"Release_Date\":\"Aug 07 1998\",\"MPAA_Rating\":\"R\",\"Running_Time_min\":null,\"Distributor\":\"Strand\",\"Source\":null,\"Major_Genre\":\"Drama\",\"Creative_Type\":null,\"Director\":null,\"Rotten_Tomatoes_Rating\":null,\"IMDB_Rating\":6.9,\"IMDB_Votes\":207}
@Folcon
Folcon / clipboard-utils.clj
Created August 24, 2011 11:50
Just a quick clipboard slip/slurp I put together because I didn't find anything similar, don't know if it's useful for anyone but found it invaluable when getting large strings being returned from the repl and sticking the result in an editor for more car
(defn get-clipboard []
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit)))
(defn slurp-clipboard []
(try
(.getTransferData (.getContents (get-clipboard) nil) (java.awt.datatransfer.DataFlavor/stringFlavor))
(catch java.lang.NullPointerException e nil)))
(defn spit-clipboard [text]
(.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil))