Skip to content

Instantly share code, notes, and snippets.

View carlmartus's full-sized avatar

Martin Sandgren carlmartus

View GitHub Profile
@carlmartus
carlmartus / mkjournal
Last active September 19, 2018 20:04
Enter journal directory with todays date and a slug description
#!/bin/sh -e
# Create a new journal directory in ~/journal Specify a journal slug (short
# non-space description). A new directory will be created with todays date as a
# prefix.
if [ -z $1 ]; then
echo "Specify journal slug as argument"
exit 1
fi
@carlmartus
carlmartus / rat1.sh
Created May 26, 2018 09:59
Mad Catz Cyborg R.A.T. 1 mouse speed script for Linux
#!/bin/sh
# This script requires 'xinput'. The speed is set to -0.8. Adjust this to your
# own preference.
xinput --set-prop "MADCATZ Mad Catz RAT1" "libinput Accel Speed" -0.8
@carlmartus
carlmartus / vimium_search_shortcuts.txt
Last active April 6, 2018 15:24
Vimium search shortcuts
du: https://duckduckgo.com/?q=test Duckduck
go: https://www.google.se/search?q=%s Google search
gi: https://www.google.se/search?q=%s&tbm=isch Google image search
yt: https://www.youtube.com/results?search_query=%s Youtube
gh: https://github.com/search?q=%s Github search
maps: https://www.google.se/maps?q=%s&=S%F6k%20i%20Google%20Maps Google maps
gist: https://gist.github.com/search?q=%s Github gist
# Development
npm: https://www.npmjs.com/search?q=%s Javascript NPM
@carlmartus
carlmartus / test.ex
Last active August 25, 2017 11:32
Elixir 1.5 supervisor problem :simple_one_for_one
defmodule Sup do
use Supervisor
def start_link, do: Supervisor.start_link(__MODULE__, [], name: __MODULE__)
def init(_) do
agent_spec = Supervisor.child_spec(Child, start: {Child, :start_link, []})
Supervisor.init([agent_spec], strategy: :simple_one_for_one)
end
cmake_minimum_required(VERSION 2.6)
# If you want a bin and lib output directory
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
add_definitions("-Wall -O2 -std=gnu11")
# Version
# =======
set(MAJOR 0)
git config --global alias.ci "commit"
git config --global alias.cia "commit --amend"
git config --global alias.ciane "commit --amend --no-edit"
git config --global alias.fe "fetch -v --all"
git config --global alias.rb "rebase -v --autostash"
git config --global alias.me "merge"
git config --global alias.meff "merge --no-edit --ff"
git config --global alias.menff "merge --no-ff"
git config --global alias.co "checkout"
git config --global alias.st "status -s -b"
# /usr/bin/cdtoday.sh
DATE=$(date "+%F")
mkdir -p ~/journal/$DATE
cd ~/journal/$DATE
# .bashrc
alias cdtoday='source /usr/bin/cdtoday.sh'
@carlmartus
carlmartus / .zshrc
Last active August 29, 2015 14:03
zsh config
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/freze/.zshrc'
autoload -Uz compinit
@carlmartus
carlmartus / i3 config
Last active August 29, 2015 14:02
i3 config
# Save as .i3/config
# Using windows key
set $mod Mod4
font -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
floating_modifier $mod
hide_edge_borders both
force_focus_wrapping no
new_window none
@carlmartus
carlmartus / PS1
Last active August 29, 2015 14:01
PS1
PS1=' \[\e[1;33m\][ \[\e[2;30m\]\W \[\e[1;33m\]] # \[\e[0m'
alias sshc='ssh -C -c arcfour'
alias scpc='scp -C -c arcfour'
alias antq='ant -q'
alias youtube-dl='youtube-dl --no-part'
alias py3='python3'
alias cmake-clear='rm -rf CMakeCache.txt CMakeFiles'