This file contains 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
nnoremap <silent> <C-o> :call FindFile()<CR> | |
function! FindFile() | |
" Get the word under cursor. | |
let cursorWord = expand("<cword>") | |
" Get the current file name and keep only the extension. | |
let currentFile = expand("%") | |
let extPos = stridx(currentFile, ".") | |
" Append an extension only if the current file has an extension. |
This file contains 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
public class MyActivity extends Activity { | |
... | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Trigger onOptionsItemSelected for the custom menu item because it doesn't | |
// happen automatically. | |
final MenuItem item = menu.findItem(R.id.button_id); | |
barcodeItem.getActionView().setOnClickListener(new OnClickListener() { | |
@Override |
This file contains 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/sh | |
# Convenience functions to set the tmux session name based on branches/pull | |
# numbers and switches branches based on the session name. | |
# | |
# Depends on tmux and https://github.com/iFixit/git-scripts. | |
# (feature|hotfix) switch based on the session name. | |
function tswitch { | |
BRANCH=$(tmux display-message -p '#S' | sed 's/|.*$//') |
This file contains 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
rsync -az --delete --exclude=.git -e 'ssh -i <identity file>' src user@host:dest |
This file contains 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
git branch -r --merged | egrep -v "(^\*|master|dev)" | sed -E 's#^.*origin/(.*)$#:\1#' | xargs git push origin |
This file contains 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 | |
set -euo pipefail | |
if [[ $# == 0 || $1 == "-h" || $1 == "--help" ]]; then | |
echo "Usage: $0 file" | |
exit 0 | |
fi | |
file="$1" |