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 -e | |
# code from https://stackoverflow.com/questions/7101145/how-to-configure-specific-upstream-push-refspec-for-git-when-used-with-gerrit/7141743#7141743 | |
if [ -z "$1" ]; then | |
REMOTE=origin | |
else | |
REMOTE=$1 | |
fi | |
if [ -z "$2" ]; then |
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
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* To use: copy this file to ~/Library/KeyBindings/ | |
* after that any Cocoa applications you launch will inherit these bindings | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* |
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 | |
# file name: xo.sh | |
# description: open xcode project in terminal quickly | |
# create date: 2016-06-08 17:49:45 | |
# author: amoblin | |
# This file is created by Marboo<http://marboo.io> template file $MARBOO_HOME/.media/starts/default.sh | |
# 本文件由 Marboo<http://marboo.io> 模板文件 $MARBOO_HOME/.media/starts/default.sh 创建 | |
#name=`basename "$1"` | |
#name_without_extension=`echo ${name%.*}` |
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 | |
PRODUCT_NAME="巴士" | |
PRODUCT_NAME="${PRODUCT_NAME##*/}" | |
NAME_IN_COMMIT=$(grep -c "\[$PRODUCT_NAME\]" $1) | |
if [ -n "$PRODUCT_NAME" ] && ! [[ $NAME_IN_COMMIT -ge 1 ]]; then | |
sed -i.bak -e "1s/^/[$PRODUCT_NAME] /" $1 | |
fi |
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
$ emacs --batch --eval "(message (version))" --eval "(package-initialize)" --eval "(message (org-version))" | |
GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19) | |
of 2014-04-02 on amoblin.local | |
8.2.5h | |
$ emacs --batch --eval "(message (version))" --eval "(package-initialize)" --eval "(message (org-version))" test.org | |
GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19) | |
of 2014-04-02 on amoblin.local | |
8.2.5h |
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 | |
local=`locale|grep LC_CTYPE|awk -F'"' '{print $2}'|awk -F'.' '{print $1}'` | |
mkdir -p "$1".localized/.localized | |
echo \"$1\" = \"$2\"\; > "$1".localized/.localized/$local.strings |
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 | |
git config --system alias.st status | |
git config --system alias.ci commit | |
git config --system alias.co checkout | |
git config --system alias.br branch | |
git config --system alias.glog log --graph | |
git config --system alias.dlog log --decorate | |
git config --system alias.plog log -p | |
git config --system alias.nlog log --name-status |
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/osascript | |
set username to "" | |
set login_passwd to "" | |
set passcode_prefix to "" | |
set dest_ip to "" | |
set init_command to "" | |
set host_name to "10.210.224.66" | |
set terminal_name to "Terminal" |
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 python | |
# -*- coding: utf8 -*- | |
# author: amoblin <[email protected]> | |
import sys, re, urllib2, os, urllib | |
beauty_url = "http://huaban.com/favorite/beauty/" | |
#beauty_url = "http://huaban.com/" | |
pin_re = '<a href="/pins/(.+?)/"' |
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 python | |
def test(): | |
print "Hello, I'm amoblin." |