Skip to content

Instantly share code, notes, and snippets.

@maio
maio / DefaultKeyBinding.dict
Created June 5, 2014 09:26
OSX KeyBindings
maio:~ $ cat ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"~d" = "deleteWordForward:";
"^w" = "deleteWordBackward:";
"~f" = "moveWordForward:";
"~b" = "moveWordBackward:";
"^/" = "undo:";
"^g" = {
"^g" = ("insertText:", "[email protected]");
"^d" = ("insertText:", "[email protected]");
(ns kata.core-test
(:require [clojure.test :refer :all]))
;; Langton's Ant - http://en.wikipedia.org/wiki/Langton's_ant
;;
;; At a white square, turn 90° right, flip the color of the square, move forward one unit
;; At a black square, turn 90° left, flip the color of the square, move forward one unit
(def flip
{:black :white
@maio
maio / deaccent.clj
Created December 26, 2014 13:06
Remove accent from string using Clojure
(defn deaccent [str]
"Remove accent from string"
;; http://www.matt-reid.co.uk/blog_post.php?id=69
(let [normalized (java.text.Normalizer/normalize str java.text.Normalizer$Form/NFD)]
(clojure.string/replace normalized #"\p{InCombiningDiacriticalMarks}+" "")))
@maio
maio / core.clj
Last active September 22, 2015 01:31
YouTube IRC bot
(ns fetaoin.core
(:require [irclj.core :as irc]
[clojure.data.json :as json]))
;; HTTP stuff
(defn fetch-json [url]
(json/read-str (slurp url)))
;; YouTube API
(def api-key "sekret")
@maio
maio / real-cpu-usage-chart.10s.sh
Last active January 5, 2016 14:17
CPU usage chart for BitBar
#!/bin/bash
# Real CPU Usage Chart
# BitBar plugin
#
# by Marian Schubert
# Based on work by Mat Ryer and Tyler Bunnell
#
# This script requires https://github.com/holman/spark
#
@maio
maio / avast-workshop-tests.org
Created December 14, 2016 05:34
Avast Workshop - Tests

Avast Workshop - Tests

@maio
maio / graphql-basics-workshop-pastebin.md
Last active December 10, 2018 10:20
GraphQL Basics Workshop
@maio
maio / README.md
Created February 2, 2019 14:16
SCRIPT-8
@maio
maio / README.md
Created February 2, 2019 14:32
SCRIPT-8
@maio
maio / README.md
Created February 2, 2019 14:34
SCRIPT-8