Skip to content

Instantly share code, notes, and snippets.

View summerblue's full-sized avatar

Summer summerblue

View GitHub Profile
@summerblue
summerblue / gist:5844267
Created June 23, 2013 08:17
change mac's system version
mate /System/Library/CoreServices/SystemVersion.plist
@summerblue
summerblue / gist:6017468
Created July 17, 2013 03:29
Java Directory in Mac
/System/Library/Frameworks/JavaVM.framework/Commands
@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: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:6208650
Created August 12, 2013 06:34
Gem-fast, make your gem install faster!, Replace gem fetcher with curl
gem install gem-fast
# 首先备份/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
RAILS_ENV=production rake db:setup
@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;
@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:6461437
Created September 6, 2013 09:14
使用PHP生成带LOGO的个性化二维码图像
$data = 'http://www.putclub.com';
$size = '200x200';
$logo = './1.jpg'; // 中间那logo图
// 通过google api生成未加logo前的QR图,也可以自己使用RQcode类生成
$png = 'http://chart.googleapis.com/chart?chs=' . $size . '&cht=qr&chl=' . urlencode($data) . '&chld=L|1&choe=UTF-8';
$QR = imagecreatefrompng($png);
if($logo !== FALSE)
{