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 config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-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
#utf setting | |
# set-window-option -g utf8 on "Deprecated since 2.2" | |
set-window-option -g mode-keys vi | |
# set-window-option -g automatic-rename off | |
setw -g automatic-rename off | |
set -s escape-time 0 | |
setw -g window-status-current-style underscore | |
# Since tmux 1.8, we can use copy-pipe to utilize the system-wide clipboard. |
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/bash | |
# Increase build number for each build. | |
# Use "Run Script" to append this script into a project's scheme. | |
buildNumber=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist) | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Switch Input Source</name> | |
<appendix>Use the right Option key to select the next input source</appendix> | |
<identifier>private.switch_input_source_with_right_option</identifier> | |
<autogen>--KeyToKey-- KeyCode::OPTION_R, KeyCode::SPACE, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L</autogen> | |
</item> | |
<item> |
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
+(NSString*)urlEscape:(NSString *)unencodedString { | |
NSString *s = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, | |
(CFStringRef)unencodedString, | |
NULL, | |
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ", | |
kCFStringEncodingUTF8); | |
return [s autorelease]; // Due to the 'create rule' we own the above and must autorelease it | |
} | |
// Put a query string onto the end of a url |
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 python | |
# -*- coding: utf-8 -*- | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
conn = S3Connection('access key', 'access secret') | |
bucket = conn.get_bucket('some-bucket') | |
# Write into 'mysql/test.txt' |
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 python | |
import paramiko | |
hostname = 'localhost' | |
port = 22 | |
username = 'foo' | |
password = 'xxxYYYxxx' | |
if __name__ == "__main__": |
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 python | |
import smtplib | |
mail_server = 'smtp.example.com' | |
mail_server_port = 465 | |
from_addr = '[email protected]' | |
to_addr = '[email protected]' |
NewerOlder