Skip to content

Instantly share code, notes, and snippets.

@taberh
taberh / gist:3719322
Created September 14, 2012 01:45
Use Core Graphics draw triangle
void drawTriangle(CGContextRef context, CGPoint startPoint, CGPoint secondPoint, CGPoint lastPoint)
{
CGContextSaveGState(context);
CGContextMoveToPoint(context, startPoint.x, startPoint.y);
CGContextAddLineToPoint(context, secondPoint.x, secondPoint.y);
CGContextAddLineToPoint(context, lastPoint.x, lastPoint.y);
CGContextClosePath(context);
CGContextFillPath(context);
CGContextRestoreGState(context);
@taberh
taberh / iOS-arc-flag
Last active October 13, 2015 05:28
arc or noarc flag
ARC: -fobjc-arc
NO-ARC: -fno-objc-arc
@taberh
taberh / README.md
Last active April 13, 2016 15:10
Convert Data URI to Blob then can append FormData

#Covert Data URI to Blob

@taberh
taberh / gist:7035606
Created October 18, 2013 02:29
批量重命名
for i in `ls`; do mv -f $i `echo $i | sed 's/{match_reg}/{replace_reg}/'`; done
@taberh
taberh / gist:9381697
Created March 6, 2014 03:24
Determine site is open as web app
window.navigator.standalone