Skip to content

Instantly share code, notes, and snippets.

View bitops's full-sized avatar

Sebastian Wittenkamp bitops

View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bitops
bitops / find_it.sh
Last active June 11, 2020 21:11
GUID regex
#!/bin/bash
grep -r -E '[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}' *

Test

@bitops
bitops / colors.el
Created March 24, 2015 20:01
My Emacs Theme :)
;; Color stuffs
;; default colors
(when window-system
(add-to-list 'default-frame-alist '(background-color . "black"))
(add-to-list 'default-frame-alist '(foreground-color . "wheat")))
(defun default-colors ()
(interactive)
(set-background-color "black")
@bitops
bitops / do_this.sh
Created March 19, 2015 05:59
URL to PDF (OS X)
brew tap Caskroom/cask
brew install Caskroom/cask/wkhtmltopdf
wkhtmltopdf http://google.com google.pdf
@bitops
bitops / hilong.rb
Last active August 29, 2015 14:16 — forked from jstorimer/hilong.rb
#!/usr/bin/env ruby
# A simply utility to show character counts for each line of input and
# highlight lines longer than 80 characters.
#
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
#
# Examples:
#
# $ hilong Gemfile
# Task: Implement the rcat utility and get these tests to pass on a system
# which has the UNIX cat command present
# To see Gregory Brown's solution, see http://github.com/elm-city-craftworks/rcat
# Feel free to publicly share your own solutions
rrequire "open3"
working_dir = File.dirname(__FILE__)
gettysburg_file = "#{working_dir}/data/gettysburg.txt"
;;; randomize-region.el --- randomize line order in a region
;; Copyright (C) 2005 Joe Corneli <[EMAIL PROTECTED]>
;; Copyright (C) 1986, 1987, 1993, 1994, 1995, 2003 Free Software Foundation,
Inc.
;; Time-stamp: <jac -- Tue Apr 26 15:30:27 CDT 2005>
;; This file is not part of GNU Emacs, but it is distributed under
;; the same terms as GNU Emacs.
@bitops
bitops / prepare-commit-msg
Created January 20, 2015 19:20
A git commit hook in Ruby for appending the name of the current branch to the commit message
#!/usr/bin/ruby
COMMIT_FILE = File.expand_path(ARGV[0])
current_branch=`git branch | grep '*' | awk '{print $2}'`
commit_msg = File.read(COMMIT_FILE)
current_branch << commit_msg
File.open(COMMIT_FILE, 'w') {|f| f << current_branch}
module Foo
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def bar
puts 'class method'
end
end