Skip to content

Instantly share code, notes, and snippets.

:octocat:
Started work for @alphagov!

Tristram Oaten 0atman

:octocat:
Started work for @alphagov!
Block or report user

Report or block 0atman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@0atman
0atman / departures.py
Last active Apr 7, 2019
A simple airport-style departures system. Hacked together in an hour
View departures.py
import os
import time
import datetime
from datetime import timedelta
from terminaltables import SingleTable
from colorclass import Color
FIVE_MINS = timedelta(minutes=5)
@0atman
0atman / set-gnome-shell-hotkeys.sh
Created Sep 29, 2014
i3 gnome-shell keyboard bindings
View set-gnome-shell-hotkeys.sh
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<alt>1']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<alt>2']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<alt>3']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<alt>4']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<alt><shift>1']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<alt><shift>2']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<alt><shift>3']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<alt><shift>4']"
@0atman
0atman / some-clojure-test.clj
Last active Nov 8, 2018
test pattern with eftest
View some-clojure-test.clj
(comment "repl experiments"
(do ; run this block to repeatably run the test
(use 'your-ns :reload-all)
(require '[eftest.runner :refer [run-tests find-tests]])
(run-tests (find-tests 'your-ns.your-test)
{:report eftest.report.pretty/report})))
View how-to-work-with-0atman.md
Key Action
cpp Evaluate the form under the cursor
K Look up the symbol under the cursor with (doc)
[ d Look up the symbol under the cursor with source
[ Ctrl+D Jumps to the definition of a symbol
gf "go to file" command, works on namespaces.
@0atman
0atman / remove-sidebar.css
Last active Oct 1, 2018 — forked from nottrobin/remove-sidebar.css
slack.com remove left sidebar
View remove-sidebar.css
/* hide the sidebar */
#team_menu {display: none;}
#col_channels_bg {display: none;}
#col_channels {display: none;}
#messages_container {margin-left: 0;}
#messages-input-container {left: -160px;}
/* move the favouites star over */
#channel_header .star {
View macro-example.clj
(defmacro conditional-run
""
[conditional form]
`(when (= conditional true)
(-> test-system ~form)))
(defmacro conditional-run-with-prepend
""
[conditional form]
`(when (= conditional true)
@0atman
0atman / Makefile
Created Jul 2, 2018
A bootstrap makefile for docker-based projects
View Makefile
help: prerequisites
@echo "Usage: make [command]"
@echo "Commands:"
@echo "up Run server"
@echo "stop Stop server"
@echo "rebuild Rebuild docker image (when requirements change)"
@echo "ps Show running server"
@echo ""
@echo "Commands can be chained, for example: make up ps logs"
@echo ""
@0atman
0atman / init.vim
Created May 15, 2018
current vim config
View init.vim
" Install vim-plug first
" curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" vim-plug {{{
call plug#begin()
" Visual marks
Plug 'kshenoy/vim-signature'
View matlock.html
<html>
<head>
</head>
<body>
<script type='text/javascript' src='https://darksky.net/widget/default/53.137156,-1.551774/uk12/en.js?width=100%&height=350&title=matlock, uk&textColor=333333&bgColor=FFFFFF&transparency=false&skyColor=333333&fontFamily=Default&customFont=&units=uk&htColor=333333&ltColor=C7C7C7&displaySum=no&displayHeader=yes'></script>
</body>
</html>
@0atman
0atman / thread.py
Last active Jan 5, 2018 — forked from anonymous/chain.py
clojure `->`-style functional threading
View thread.py
from functools import reduce
def thread(*args):
"functional thread, inspired by clojure and https://stackoverflow.com/a/17122666/333294"
caller = lambda x, y: y(x)
return reduce(caller, args[1:], args[0])
You can’t perform that action at this time.