This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Transport{ | |
fun <T : Resource> get(kind: Kind, name: String): T? | |
fun <T : Resource> list(kind: Kind): List<T> | |
} | |
class HTTPTransport : Transport { | |
override fun <T : Resource> get(kind: Kind, name: String): T? { | |
return null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Informer<T : Resource>(val blah : Int = 1) { | |
private var started = false | |
fun start(): Boolean { | |
if (!started) { | |
this.started = true | |
return true | |
} else { | |
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tenniskata | |
enum class ConditionStatus { Unknown, True, False } | |
abstract class ResourceCondition( | |
val name: String, | |
val status: ConditionStatus = ConditionStatus.Unknown | |
) | |
sealed class SitepodCondition( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xinput -disable $(xinput -list | grep Touchpad | sed -e 's/.*id=\([0-9]\+\).*/\1/') | |
xdotool mousemove 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new Promise((resolve, reject) => { | |
this.pool.query(queryStatement, values, (err, results) => { | |
if (err) { | |
return reject(err); | |
} | |
return resolve(results); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:user {:plugins [[org.clojure/tools.namespace "0.2.4"]] | |
:injections [(require '[clojure.tools.namespace.repl :refer [refresh]])] | |
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns acme.sheets | |
(:require [midje.sweet :refer :all]) | |
(:require | |
[clj-time.core :as t] | |
[clj-time.coerce :refer [to-long]] | |
[clj-http.client :as client] | |
[byte-streams :refer [to-input-stream]] | |
[cheshire.core :refer [parse-stream]] | |
[clj-jwt.core :refer [jwt sign to-str]] | |
[clj-jwt.key :refer [private-key]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# require unzip | |
UNZIP=$(which unzip) | |
if [ $? -ne 0 ]; then | |
echo "Error: requires unzip command" | |
exit 1 | |
fi | |
# pull the first level dependencies from lein via some sed pain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keys = Object.keys(CKEDITOR.instances); | |
for(var i=0;i<keys.length;i++) { | |
var key = keys[i]; | |
var config = CKEDITOR.instances[key].config; | |
if(config.toolbar.length > 0) { | |
config.toolbar = null; | |
CKEDITOR.instances[key].destroy(); | |
CKEDITOR.replace(key, config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def form-app-state { }) | |
(def schema { | |
:first-name {:type :text | |
:label "First Name" | |
:required true } | |
:middle-names {:type :text | |
:label "Middle Name(s)" | |
:required false } | |
:surname {:type :text |