Skip to content

Instantly share code, notes, and snippets.

View summerblue's full-sized avatar

Summer summerblue

View GitHub Profile
@summerblue
summerblue / gist:6229520
Created August 14, 2013 09:46
Objective-C 上的单例模式 , 非 ARC 模式下
// ------------------------------- MyManager.h non-ARC ----------------------------------------//
#import "MyManager.h"
static MyManager *sharedMyManager = nil;
@implementation MyManager
@summerblue
summerblue / gist:6229493
Last active December 21, 2015 01:39
Objective-C 上的单例模式 , ARC 模式下
// ------------------------------------ MyManager.h ----------------------------------------//
#import <foundation/Foundation.h>
@interface MyManager : NSObject {
NSString *someProperty;
}
@property (nonatomic, retain) NSString *someProperty;
RAILS_ENV=production rake db:setup
# 首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
@summerblue
summerblue / gist:6208650
Created August 12, 2013 06:34
Gem-fast, make your gem install faster!, Replace gem fetcher with curl
gem install gem-fast
@summerblue
summerblue / gist:6208645
Created August 12, 2013 06:32
增加 RubyGems 镜像 - 淘宝网 , 解决 gem install 时 connection reset 的问题
## first of all : I LOVE TAOBAO
$ gem sources --remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org
# 请确保只有 ruby.taobao.org
$ gem install rails
@summerblue
summerblue / gist:6203136
Last active December 20, 2015 22:09
SCP - Transferring files over SSH
# cp remote file to local
scp user@remote_host:remote_file local_file
# cp local file to remote
scp local_file user@remote_host:remote_file
@summerblue
summerblue / gist:6017468
Created July 17, 2013 03:29
Java Directory in Mac
/System/Library/Frameworks/JavaVM.framework/Commands
@summerblue
summerblue / gist:5844267
Created June 23, 2013 08:17
change mac's system version
mate /System/Library/CoreServices/SystemVersion.plist
@summerblue
summerblue / gist:5791164
Created June 16, 2013 07:01
Finding the process that is using a certain port in Linux, using the pid to kill
lsof -i tcp:7070