Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# adapted from http://stackoverflow.com/questions/4060212/in-linux-how-do-i-run-a-shell-script-when-a-file-or-directory-changes/20381373#20381373
DIRECTORY_TO_OBSERVE="src"
BUILD_SCRIPT=./gradlew
function block_for_change {
inotifywait -r \
-e modify,move,create,delete \
--exclude ".*/build/.*" \
@bamboo
bamboo / styles.less
Created November 13, 2014 09:55
My atom stylesheet (goes well with atom-soda-dark and monokai-soda)
.workspace {
font-size: 15pt;
text-rendering: optimizeLegibility;
}
.tree-view {
font-size: 14pt;
}
.editor {
@bamboo
bamboo / core.clj
Created June 12, 2015 15:17
system-composition in clojure
(ns composition.core
(:require [com.stuartsierra.dependency :as dep]))
#_(defprotocol Component ; an interesting thought
(dependencies [component])
(constructor [component configuration]))
(defn using [dependencies constructor]
{::dependencies dependencies
::constructor constructor})
@bamboo
bamboo / HelloWorld.il
Created July 27, 2015 10:42
idris-cil - Hello World
.assembly extern mscorlib
{
.ver 2:0:0:0
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
}
.assembly 'HelloIdris' {}
.class private M
{
.method static assembly object call__IO(object e0, object e1, object e2) cil managed
{
@bamboo
bamboo / *>.lisp
Last active August 29, 2015 14:27
SFun Prelude.Applicative.*>
SFun Prelude.Applicative.*> [{e0},{e1},{e2},{e3},{e4},{e5}] 5
(SLet (Loc 6)
(SLet (Loc 6)
(SLet (Loc 6) SNothing
(SLet (Loc 7) SNothing
(SLet (Loc 8) SNothing
(SApp False Prelude.Applicative.<*> [Loc 6,Loc 7,Loc 8,Loc 3]))))
(SLet (Loc 7)
(SLet (Loc 7)
(SLet (Loc 7)
@bamboo
bamboo / ExternalComponentsAsFirstClassElements.gradle
Last active November 24, 2015 10:18
External Components as First Class Model Elements
model {
components {
// External components are modeled just like internal ones.
mavenLibrary 'collections' {
org 'com.acme'
version '1.0'
}
@bamboo
bamboo / build.gradle.kts
Created May 30, 2016 14:26
Repro project for gradle/kotlin-dsl-samples#25 - loader constraint violation error
import org.gradle.api.artifacts.dsl.*
import org.gradle.api.plugins.*
import org.gradle.api.publish.*
import org.gradle.api.publish.maven.*
import org.gradle.api.tasks.bundling.Zip
import org.gradle.api.tasks.bundling.ZipEntryCompression
import org.gradle.jvm.tasks.Jar
import org.gradle.script.lang.kotlin.*
import java.util.concurrent.Callable
@bamboo
bamboo / popcnt-after-optimization.il
Created November 27, 2016 18:12
Idris bit population count as emitted by idris-cil before and after boxing optimization
.method static assembly object 'Data.HashSet.popcnt'(object 'e0') cil managed
{
.maxstack 2
.locals init (
int32 l0,
int32 l1,
int32 l2,
int32 l3,
int32 l4,
int32 l5)
@bamboo
bamboo / dotnet-idris-faster-than-idris.md
Created January 9, 2017 18:12
dotnet core can execute idris faster than idris
➜  /tmp  time ./pythag-idris > /dev/null
4.49s user 0.02s system 99% cpu 4.514 total
➜  /tmp  time dotnet pythag-idris.exe > /dev/null
4.23s user 0.03s system 99% cpu 4.265 total

pythag.idr

@bamboo
bamboo / build.gradle
Last active May 11, 2020 11:25
Drive kotlinc from build.gradle
// Execute Kotlin script with:
//
// gradle -q foo
//
// For correctness, we're going to configure two independent classpath configurations, one for kotlinc and the other for the
// script(s) we want to execute.
configurations {
kotlinc