Skip to content

Instantly share code, notes, and snippets.

@Velrok
Velrok / swarm.json
Created December 21, 2014 23:26
Example swarm config file.
{
"app_name": "mb",
"services": [
{
"service_name": "mb-service",
"components": [
{
"component_name": "mb",
"image": "registry.giantswarm.io/velrok/mb:$version",
"ports": [ "3000/tcp" ],
[{:key :email-consent
:type :yes-no
:tags [#{:application/energy-offline}]
:schema (shared/map-has {:email-consent shared/Yes-No})
:group groups/account
:label "Would you like E.ON to email you account management reminders?"
:help-text "E.ON may also use these details to write to you about your account once your switch is complete."}]
@Velrok
Velrok / autorepl.sh
Created August 6, 2014 14:03
run 'lein repl' on entering a leiningen project folder without a running repl #zsh
# run lein repl if no repl was allready started for this project
function chpwd {
if [[ -e "$(pwd)/project.clj" ]] && [[ ! -e "$(pwd)/.nrepl-port" ]]
then
echo "Detected clojure project but no .nrepl-port -> running: lein repl."
lein repl &
fi
}
@Velrok
Velrok / .ctags
Created May 13, 2014 09:49
ctags file with rudementary clojure support.
--recurse=yes
--tag-relative=yes
--exclude=.git
--langdef=Clojure
--langmap=Clojure:.clj
--regex-clojure=/\([ \t]*create-ns[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/n,namespace/
--regex-clojure=/\([ \t]*def[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/d,definition/
--regex-clojure=/\([ \t]*defn-?[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/f,function/
--regex-clojure=/\([ \t]*defmacro[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/m,macro/
@Velrok
Velrok / goto-sleep.sh
Created October 30, 2013 00:28
A bash script for mac that uses an apple script to put the mac to sleep without the need to enter the password.
#!/bin/bash
if [ -n "$1" ]
then
minutes=$(($1 * 60))
echo "going to sleep in $1 minutes"
sleep $minutes
fi
echo "sleeping now"
osascript -e 'tell app "Finder" to sleep'
@Velrok
Velrok / big-data.bib
Created October 2, 2013 13:09
all my latex references are suddenly broken
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Waldemar S at 2013-10-02 14:53:53 +0200
%% Saved with string encoding Unicode (UTF-8)
@Velrok
Velrok / random_name_generator.clj
Created September 28, 2013 11:45
Random name generator using combining adjectives with animals.
(def adjectives [
"adorable"
"adventurous"
"aggressive"
"alert"
"attractive"
"average"
"beautiful"
"blue-eyed "
"bloody"
@Velrok
Velrok / graphs.R
Created September 20, 2013 13:43
My R graphs.
source("helpers.R")
filter.effects.DE<- function(filename, title, colors){
data <- load.dataset(filename)
bots.with <- filter(data, "data.set", "DE 2013-05 without bot filtering")
bots.with.given1 <- only.given.1(bots.with)
bots.with.allbut1 <- only.all.but.1(bots.with)
bots.without <- filter(data, "data.set", "DE extra bot filtering")
@Velrok
Velrok / gist:6379635
Created August 29, 2013 15:33
XMPP log. Bot is not responding to messages :( . Don't know why.
Invalid debugflag given: always
Invalid debugflag given: nodebuilder
DEBUG:
DEBUG: Debug created for /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xmpp/client.py
DEBUG: flags defined: always,nodebuilder
DEBUG: socket start Plugging <xmpp.transports.TCPsocket instance at 0x10595de18> into <xmpp.client.Client instance at 0x10595dd88>
DEBUG: socket warn Could not load one of the supported DNS libraries (dnspython or pydns). SRV records will not be queried and you may need to set custom hostname/port for some servers to be accessible.\n
DEBUG: socket start Successfully connected to remote host ('jabber.de', 5222)
DEBUG: dispatcher start Plugging <xmpp.dispatcher.Dispatcher instance at 0x10595def0> into <xmpp.client.Client instance at 0x10595dd88>
DEBUG: dispatcher info Registering namespace "unknown"
@Velrok
Velrok / btsync.conf
Created August 27, 2013 20:46
My btsync upstart script.
setuid xbmc
setgid xbmc
start on virtual-filesystem
expect fork
exec /home/xbmc/bin/btsync
respawn