Skip to content

Instantly share code, notes, and snippets.

View vc7's full-sized avatar
🇹🇼
ミルクティー大好き

Lihsuan Chen vc7

🇹🇼
ミルクティー大好き
View GitHub Profile
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Information</key>
<dict>
<key>Description</key>
<string>Map Rails ActiveSupport timezones to iOS readable timezone IDs.</string>
<key>Version</key>
<string>1.0</string>
@vc7
vc7 / ASUS-Fonepad-7-ME372CL.markdown
Last active August 29, 2015 14:11
ASUS - Fonepad 7 - ME372CL

ASUS - Fonepad 7 - ME372CL

Spec

  • Android 4.3
  • CPU: Intel® Atom™ Z2560 1.6 GHz 雙核心
  • Memory: 1GB
  • Micro SIM
  • 4G LTE 700/800/900/1800/2600
  • Wi-Fi: 802.11 a/b/g/n
@vc7
vc7 / checkISBN.m
Last active August 29, 2015 14:08
check isbn in objc
#pragma mark - ISBN Logic
- (BOOL)checkISBN:(NSString *)ISBN error:(NSError * __autoreleasing *)error
{
if (ISBN.length != 10 || ISBN.length != 13) {
NSInteger checkSum = 0;
NSInteger length = ISBN.length;
if (length == 10) {
@vc7
vc7 / Big5toUTF8.m
Created August 22, 2014 08:30 — forked from zonble/Big5toUTF8.m
NSStringEncoding big5 = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingBig5_HKSCS_1999);
NSString *string = [[NSString alloc] initWithData:data encoding:big5];
NSData *UTF8Data = [string dataUsingEncoding:NSUTF8StringEncoding];
[string release];
module ProductsHelper
def render_product_grid (products)
@result = " "
products.each do |product, index|
@result = @result + render_product_item(product)
end
<td>
<a href="" class="btn btn-xs <%= (order.process_state == "shipped" || order.process_state == "shipping" ||order.process_state == "order_placed" || order.process_state == "paid")? "btn-success" : "btn-default"%>" >已下訂</a>
<i class="glyphicon glyphicon-chevron-right"></i>
<a href="" class="btn btn-xs <%= (order.process_state == "shipped" || order.process_state == "shipping" || order.process_state == "paid")? "btn-success" : "btn-default"%>">已付款</a>
<i class="glyphicon glyphicon-chevron-right"></i>
<a href="" class="btn btn-xs <%= (order.process_state == "shipped" || order.process_state == "shipping")? "btn-success" : "btn-default"%>">出貨</a>
<i class="glyphicon glyphicon-chevron-right"></i>
<a href="" class="btn btn-xs <%= (order.process_state == "shipped")? "btn-success" : "btn-default"%>">已到貨</a>
</td>
@vc7
vc7 / SystemSpec.markdown
Last active August 29, 2015 14:02
pow installation failed

System Specs

  • OSX 10.10 (beta)
  • curl 7.30.0
  • rvm 1.25.19
  • ruby 2.1.1p76

Situation

從 10.9 更新系統到 10.10 之後,pow 無法辨識 .dev 域名,也有確認 pow 有開啟。所以重裝看看,就發生 !!! Couldn't resolve configured domains (dev) 這個錯誤,install_log.sh 這個檔案是我讓他 print 出安裝的過程,想請問一下可以怎麼解決 :)

  • no fast forward: git merge --no-ff ### Regular Usage - stage the unstaged files, deleted filed included: git add -u
  • unstage a file: git reset [filename]
@vc7
vc7 / rawData.m
Created May 8, 2014 05:59
photo raw data from iOS
{
DPIHeight = 72;
DPIWidth = 72;
Orientation = 6;
"{Exif}" = {
ApertureValue = "2.27500704749987";
BrightnessValue = "3.137031630662469";
ColorSpace = 1;
DateTimeDigitized = "2014:05:08 13:57:14";
DateTimeOriginal = "2014:05:08 13:57:14";