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
# Description: | |
# Retrieve the plans which are on weekdays from specified Google Calendar. | |
# | |
# Commands: | |
# hubot #{Words to run this} | |
# | |
# Notes: | |
# Displayed plan is found first. | |
# PLEASE FIX ME!!! |
things to build when setting up new machine
Working in progress.
- Install all
- Sublime Text
- Google Chrome
- iTerm2
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
git::logger() { | |
: | |
if [ "$1" = "subtree" ]; then | |
if [ "$2" = "add" ]; then | |
# --: git subtree add --prefix=<prefix> <commit> | |
# or: git subtree add --prefix=<prefix> <repository> <ref> | |
# or: git subtree merge --prefix=<prefix> <commit> | |
# or: git subtree pull --prefix=<prefix> <repository> <ref> | |
# or: git subtree push --prefix=<prefix> <repository> <ref> | |
# or: git subtree split --prefix=<prefix> <commit...> |
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
preexec_on_bash() { | |
[ -z "$COMP_LINE" ] && [ ! "$BASH_COMMAND" = "$PROMPT_COMMAND" ] && { | |
# $BASH_COMMAND is input commands which are separated by '|', ';' etc.. | |
if [[ $BASH_COMMAND =~ ^\\?git\ ]]; then | |
: | |
fi | |
} | |
} | |
trap 'preexec_on_bash' DEBUG |
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
brew::logger() { | |
local history_file="${BREW_LOGGER_LOCATION:-$HOME}/.brew_history" | |
echo "$(date +%s) brew $@" >> "${history_file}" | |
command brew "$@" | |
# Compress each of sequences which are continuous executed commands | |
cat "${history_file}"|tail -r|uniq -f1|tail -r > "${history_file}.backup" | |
mv -f "${history_file}.backup" "${history_file}" | |
} |
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 | |
set -x | |
### for opt-parse | |
_MY_NAME=$(basename $0) | |
_MY_LOCATION="$(\cd "$(dirname "${BASH_SOURCE:-${(%):-%N}}")"; _pwd=`pwd`/${_MY_NAME}; | |
\cd "$(dirname `readlink -f ${_pwd} 2> /dev/null||readlink ${_pwd} 2> /dev/null` 2> /dev/null)" ; pwd)" | |
_MY_VERSION='0.1' | |
_DEFAULT_ARGS="$@" |
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
file=$0 | |
output="output.file" | |
from_b=`tail -r ${file}|grep -n .|grep "#### template"|head -1|grep -o "[0-9]*"` | |
cat ${file}|tail -${from_b} > "${output}" | |
eval echo "\"$(cat ${output})\"" > "${output}" | |
// do something | |
exit 0 |
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
function main() | |
{ | |
Object::class.new Test object1 | |
object1.test_echo | |
} | |
function Object::class.new() { | |
local class=$1 | |
local self=$2 |