Skip to content

Instantly share code, notes, and snippets.

View basecode's full-sized avatar

Tobi Reiss basecode

  • Adobe
  • Basel
View GitHub Profile
@basecode
basecode / UIImage+ColorOverlayCategory.h
Created January 8, 2012 22:18
UIImage Category: Image with UIColor overlay (kCGBlendModeColor, ARC enabled)
// UIImage+ColorOverlayCategory.h
// Created by Tobias Reiss, @basecode on 1/8/12.
#import <UIKit/UIKit.h>
@interface UIImage (ColorOverlayCategory)
- (UIImage*)imageWithColorOverlay:(UIColor*)colorOverlay;
@end
@basecode
basecode / detect_special_characters.py
Created December 22, 2011 11:15
'no-break space' detection plugin for Sublime Text 2
# encoding: utf-8
import sublime, sublime_plugin
class DetectSpecialCharacters(sublime_plugin.EventListener):
def on_load(self, view):
sublime.status_message("detect_special_characters is active")
def on_modified(self, view):
# find no-break space
special_characters = view.find_all(u"\u00A0")
@basecode
basecode / animStartTime.js
Created June 16, 2011 19:19
animationStartTime: shim layer with Date.now() fallback
window.animStartTime = (function(w) {
return w.animationStartTime ||
w.webkitAnimationStartTime ||
w.mozAnimationStartTime ||
w.oAnimationStartTime ||
w.msAnimationStartTime ||
+new Date();
})(window);
@basecode
basecode / gist:995230
Created May 27, 2011 13:20
Raphael.fn.canvas2dArc
var round = function(value) {
return Math.round(value*100)/100;
};
Raphael.fn.canvas2dArc = function(x, y, radius, aStartAngle, aEndAngle, anticlockwise) {
var startX, startY, endX, endY;
var fullCircle = 2 * Math.PI;
var startAngle = (anticlockwise || 0) ? aEndAngle : aStartAngle;
var endAngle = (anticlockwise || 0) ? Math.abs(fullCircle - aStartAngle) : aEndAngle;