This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save as ~/.config/fish/functions/commit.fish | |
# Use: | |
# Assuming you are in a git repository of a bitbucket / jira branch using the atlassian jira git flow conventions | |
# example "feature/EXP-1337-cool-new-feature | |
# | |
# MAC USERS CHANGE "sed -r" to "sed -E" | |
# | |
# > commit | |
# will expand to | |
# > git commit -m 'EXP-1337: ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save as ~/.zsh/function/vcs_commit | |
# | |
# In your ~/.zshrc | |
# | |
# fpath=(~/.zsh/function $fpath) | |
# autoload vcs_commit | |
# zle -N vcs_commit | |
# bindkey '\ec' vcs_commit | |
# | |
# Loads the widget and also binds it to Alt+c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .zsh/function/vcs_status | |
# | |
# Modify .zshrc: | |
# | |
# fpath=(~/.zsh/function $fpath) | |
# | |
# autoload vcs_status | |
# zle -N vcs_status | |
# bindkey '\es' vcs_status | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mget(dic, *keys): | |
ret = dic | |
last_key = keys[-1] | |
for key in keys[:-1]: | |
ret = ret.get(key, {}) | |
return ret[last_key] | |
def mgetd(dic, *keys): | |
ret = dic | |
last_key = keys[-2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_nfs = ! RUBY_PLATFORM.downcase.include?("linux") | |
if (use_nfs) | |
node.vm.synced_folder ".", "/vagrant", type: "nfs" | |
else | |
node.vm.synced_folder ".", "/vagrant" | |
owner: "www-data", group: "www-data" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /proc/modules | cut -f 1 -d " " | while read module; do \ | |
echo "Module: $module"; \ | |
if [ -d "/sys/module/$module/parameters" ]; then \ | |
ls /sys/module/$module/parameters/ | while read parameter; do \ | |
echo -n "Parameter: $parameter --> "; \ | |
cat /sys/module/$module/parameters/$parameter; \ | |
done; \ | |
fi; \ | |
echo; \ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SERVICE="postgres" | |
DBNAME="mydb" | |
PORT="$1" | |
USER="$2" | |
PASS="$3" | |
MAX=30 | |
IT=0 | |
SLEEP_SECONDS=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list-phony: | |
@perl -ne 'push @a, $$1 if m/^([\w\d-]+):\s/; END { print ".PHONY: ", join(" ", sort @a), "\n" }' Makefile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/perl | |
# | |
# Run on unix like Systems | |
# | |
# Execute this from the directory where your "tsconfig.json" and "app" resides as following: | |
# | |
# find . -name "*.ts" | xargs -n 1 perl convert.pl | |
# | |
# Add this to tslint.json 'compilerOptions' | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ -e $HOME/.zsh/chpwd_profiles.zsh ]]; then | |
source $HOME/.zsh/chpwd_profiles.zsh | |
zstyle ":chpwd:profiles:/home/${USER}/projects(|/|/*)" profile projects | |
zstyle ":chpwd:profiles:(|/|/*)" profile default | |
# configuration for profile 'projects': | |
chpwd_profile_projects() { | |
[[ ${profile} == ${CHPWD_PROFILE} ]] && return 1 | |
print "chpwd(): Switching to profile: $profile" |