Skip to content

Instantly share code, notes, and snippets.

View mijoharas's full-sized avatar

Michael Hauser-Raspe mijoharas

View GitHub Profile
@mijoharas
mijoharas / ARCH_INSTALL.MD
Created February 7, 2018 20:50 — forked from heppu/ARCH_INSTALL.MD
Installing Arch with GPT, LUKS, LVM and systemd-boot

Create bootable USB

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress && sync

Boot from USB and set prepare system

loadkeys <your-keymap>
@mijoharas
mijoharas / README.md
Last active December 21, 2021 16:28
navigate emacs or i3 depending on whether emacs is focussed.

i3-navigate-emacs

Usage:

Create bash file above and put it in your path. add these lines to your i3/config:

# change focus
bindsym $alt+$left exec i3-navigate-emacs left
bindsym $alt+$down exec i3-navigate-emacs down
bindsym $alt+$up exec i3-navigate-emacs up
@mijoharas
mijoharas / ruby_profile_file.rb
Created August 30, 2016 16:04
profiling ruby file approaches
require 'ruby-prof'
filename = '/tmp/example.txt'
File.delete(filename)
# profile first method
RubyProf.start
(1..100_000).each do |i|
defmodule PuzzledPintScriptElixir do
HTTPotion.start
defp get_file_strings do
File.read! "/usr/share/dict/cracklib-small"
end
def list_of_urls do
base_string = "http://www.puzzledpint.com/puzzles/august-2015/semaphore/"
list_of_words = get_file_strings
list_of_lines = String.split(list_of_words, "\n", trim: true)

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@mijoharas
mijoharas / README.md
Last active August 29, 2015 13:57 — forked from JoelBesada/README.md
OpenSpritz

This is a wrapper for the OpenSpritz bookmarklet from here

========================== This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
@mijoharas
mijoharas / .zshrc
Created December 5, 2013 13:01
My zshrc
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
@mijoharas
mijoharas / .emacs
Created December 2, 2013 22:57
emacs
; list the packages you want
; (setq package-list '(auto-complete
; auto-complete-clang
; auto-indent-mode
; evil
; flycheck
; magit
; molokai-theme
; org
; smex
@mijoharas
mijoharas / helper.rb
Created November 19, 2013 19:49
Ruby Helpers
def time(&block)
start = Time.now
p block.call
p "that took #{Time.now-start}"
end