Skip to content

Instantly share code, notes, and snippets.

View nickcheng's full-sized avatar
🛴
Transforming

nickcheng nickcheng

🛴
Transforming
View GitHub Profile
@mikaelbartlett
mikaelbartlett / UILabelStrikethrough.h
Created June 29, 2011 19:33
Simple class for IOS SDK UILabel with strikethrough
@interface UILabelStrikethrough : UILabel {
int xOffset;
int yOffset;
int widthOffset;
int stroke;
UIColor* strokeColor;
}
@property (nonatomic) int xOffset;
@property (nonatomic) int yOffset;
@property (nonatomic) int widthOffset;
@cxa
cxa / NSUserDefaults
Created September 12, 2011 02:22
NSUserDefaults shortcut
#define DEFAULTS(type, key) ([[NSUserDefaults standardUserDefaults] type##ForKey:key])
#define SET_DEFAULTS(Type, key, val) do {\
[[NSUserDefaults standardUserDefaults] set##Type:val forKey:key];\
[[NSUserDefaults standardUserDefaults] synchronize];\
} while (0)
@julionc
julionc / slideshare-dl.py
Created September 17, 2011 16:11
slideshare-dl is a small command-line program for downloading slides from SlideShare.net
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
slideshare-dl.py
~~~~~~~~~~~~~~~~
slideshare-dl is a small command-line program
for downloading slides from SlideShare.net
@liamdon
liamdon / gist:2467603
Created April 22, 2012 23:53
CoffeeScript, Jade and Stylus syntax highlighting in Sublime Text 2

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2

@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@romainbriche
romainbriche / TweetViaTweetbot.applescript
Created August 3, 2012 16:19
Copy title and URL of the current page in Safari to a new tweet in Tweetbot for Mac
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
on copyTitleAndLinkToTweetbot(theTitle, theURL)
tell application "System Events"
set tweet to theTitle & " " & theURL & " via @"
set the clipboard to tweet as text
@mrluanma
mrluanma / requirements.txt
Created September 4, 2012 14:40
Python 登录新浪微博(requests 真的比 urllib2 强了 2^^32 倍 pip install requests)
requests==2.4.3
rsa==3.1.4
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@angelolloqui
angelolloqui / UIImage+H568.m
Last active October 6, 2022 16:35
iPhone5 UIImage method swizzling to load -568h images
//
// UIImage+H568.m
//
// Created by Angel Garcia on 9/28/12.
// Copyright (c) 2012 angelolloqui.com. All rights reserved.
//
#import <objc/runtime.h>
@implementation UIImage (H568)
@huacnlee
huacnlee / gist:3936299
Created October 23, 2012 02:19
Mac 清理 TextMate 2 不断升级带出一堆多余的打开方式
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user