Instantly share code, notes, and snippets.

View set.smt2
; uninterpreted sort
(declare-sort Elt)
(define-sort Set (Elt) (Array Elt Bool))
; bijection Int <=> Elt
(declare-fun mkint (Int) Elt)
(declare-fun unmkint (Elt) Int)
(assert (forall ((x Int)) (= x (unmkint (mkint x)))))
(assert (forall ((e Elt)) (= e (mkint (unmkint e)))))
View ATS.sublime-build
"cmd": ["patscc", "$file"],
"shell": false,
"selector": "source.ats",
"env": {
"file_regex": "^(.+): \\d+\\(line=(\\d+), offs=(\\d+)\\) -- \\d+\\(line=\\d+, offs=\\d+\\): (.+)",
"variants": [
View texsvg.hs
import Text.Pandoc.JSON
import System.Directory
import System.FilePath ((</>))
import qualified Data.Hash.MD5 as MD5
import System.IO.Temp
import System.Process
import Control.Monad (unless)
main :: IO ()
main = toJSONFilter mathToSvg
View One Liner to Download the Latest Release from Github
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \

I pasted it here because it is hard to find for me. It is publicly available at here. The total order and canonical form is clearly presented here over the original ml-ulex paper.

(* reg-exp-fn.sml
 * COPYRIGHT (c) 2005 
 * John Reppy (
 * Aaron Turon (
 * All rights reserved.

User Key Bindings

	{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
	{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
	{ "keys": ["f3"], "command": "find_next"}
View gist:f7a60d7de1ac321bed4b
... 2>&1 | sed 's/S2\(E\|RT\)\|_type\|_t0ype\|C3NSTR\|_bool//g' | sed -e "s/\(cst\|BASpre\)(\(\\w\+\))/\2/g" | em "line=\d+" -f red | em "\[\w+\]" -f yellow | em "SHOWTYPE" -f blue | em "needed term" -l -f bold | sed -e "s/Var([0-9]\+->var(\(\\w\+\)([0-9]\+)))/\1/g" | sed -e "s/app(\(.*\); \(.*\))/\1(\2)/g"
docker rmi $(docker images | grep "^<none>" | tr -s ' ' | cut -d ' ' -f 3)
sudo add-apt-repository -y ppa:synapse-core/ppa
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3
sudo add-apt-repository -y ppa:moka/stable
sudo add-apt-repository -y ppa:ricotz/docky
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y moka-gnome-shell-theme plank moka-icon-theme faba-icon-theme faba-mono-icons plank-theme-orchis
sudo apt-get install -y synapse sublime-text-installer curl build-essential wget oracle-java8-installer

Repeat a SQL Multiple Times using db2batch

Just enclose the SQL statements within --#BGBLK and --#EOBLK and feed it with a repeat-count as shown in input.sql.

Then run

db2batch -n DATABASE_NAME -f input.sql