Skip to content

Instantly share code, notes, and snippets.

View sitepodmatt's full-sized avatar

Mãtt Freèman sitepodmatt

  • Everywhere
View GitHub Profile
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);
#!/bin/bash
existingWindow=$(xdotool search --class terminal | head -n1)
existingScratch=$(tmux list-sessions | cut -d: -f1 | grep ^scratch)
if [[ -z $existingScratch ]]; then
tmux new-session -d -s scratch
fi
if [[ -n $existingWindow ]]; then
existingClient=$(tmux list-clients | cut -d: -f1 | head -n1)
--
-- xmonad example config file for xmonad-0.9
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
-- NOTE: Those updating from earlier xmonad versions, who use
-- EwmhDesktops, safeSpawn, WindowGo, or the simple-status-bar
@sitepodmatt
sitepodmatt / pulldeps.bash
Last active October 18, 2015 06:55
hacky bash script to pull clojure lein project deps into a local directory
#!/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
@sitepodmatt
sitepodmatt / profiles.clj
Created November 14, 2015 08:22
~/.lein/profiles.clj
{:user {:plugins [[org.clojure/tools.namespace "0.2.4"]]
:injections [(require '[clojure.tools.namespace.repl :refer [refresh]])]
}}
(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
@sitepodmatt
sitepodmatt / sheets.clj
Last active December 5, 2016 07:28
oauth2 experiment
(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]]))
return new Promise((resolve, reject) => {
this.pool.query(queryStatement, values, (err, results) => {
if (err) {
return reject(err);
}
return resolve(results);
});
});
#!/bin/bash
xinput -disable $(xinput -list | grep Touchpad | sed -e 's/.*id=\([0-9]\+\).*/\1/')
xdotool mousemove 0 0
package tenniskata
enum class ConditionStatus { Unknown, True, False }
abstract class ResourceCondition(
val name: String,
val status: ConditionStatus = ConditionStatus.Unknown
)
sealed class SitepodCondition(