Skip to content

Instantly share code, notes, and snippets.

View ahmetabdi's full-sized avatar
:shipit:

Ahmet Abdi ahmetabdi

:shipit:
View GitHub Profile
[user]
email = ahmetabdi@gmail.com
name = Ahmet Abdi
[alias]
br = branch
; Example: g ch master...staging
ch = log --cherry --pretty=format:\"%C(auto)%h (%ar) %an: %s\" --date-order --reverse
ci = commit
co = checkout
### Show stack trace for 500 errors
### (adapted from https://gist.github.com/1079020)
# Given an application, yield to a block to handle exceptions
class ExceptionRaiserApp
def initialize(app)
@app = app
end
def call(env)
# =================================
# = Warped shadow for any CGLayer =
# =================================
def warpShadow(rect, offset)
size = rect.size
path = UIBezierPath.bezierPath
# Top/Right: ````|
path.moveToPoint([offset, offset])
path.addLineToPoint([size.width - offset, offset])