Skip to content

Instantly share code, notes, and snippets.

View Dan1jel's full-sized avatar

Danijel Wallenborg Dan1jel

View GitHub Profile
@Cacodaimon
Cacodaimon / .bashrc
Last active December 7, 2020 22:33
A powerline inspired bashrc
#!/bin/bash
[ -z "$PS1" ] && return
# ~/.local/share/fonts/
# https://github.com/powerline/fonts
color_black_black='\[\e[0;30m\]'
color_black_red='\[\e[0;31m\]'
color_black_green='\[\e[0;32m\]'
@vgerak
vgerak / .zshrc
Last active January 31, 2021 17:54
GLaDOS greeting screen for bash/zsh (mac)
findcpu(){
sysctl -n machdep.cpu.brand_string
}
findkernelversion(){
uname -mrs
}
mem=$(sysctl -n hw.memsize)
#!/bin/sh
SEP=
SEPE=
CLOCK=⌚
CALENDAR=☼
MUSIC=♫
WIDTH=${1}
@todgru
todgru / starttmux.sh
Last active June 2, 2026 22:32
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@sadlerjw
sadlerjw / handbrake.sh
Created August 5, 2013 20:48
Shell script to do batch encoding using HandBrakeCLI. Automatically invokes HandBrakeCLI on each file passed in (you can also use BASH wildcards) and creates a new .m4v file (if one doesn't already exist). My script uses the "AppleTV 2" preset - just modify the script to use a different one.
#!/bin/bash
for f in "${@}"
do
if [ ! -f "${f%.*}.m4v" ]; then
HandBrakeCLI --preset="AppleTV 2" -i "$f" -o "${f%.*}.m4v"
else
echo "Skpping $f - already exists: ${f%.*}.m4v"
fi
done
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"