Skip to content

Instantly share code, notes, and snippets.

@Inferis
Inferis / UIColor+Hex.h
Created January 13, 2011 23:24
Hex + CSS extensions to create UIColors from hex colour values or CSS colour strings.
//
// UIColor+Hex.h
//
// Created by Tom Adriaenssen on 13/01/11.
//
@interface UIColor (Hex)
+ (UIColor*) colorWithCSS: (NSString*) css;
+ (UIColor*) colorWithHex: (NSUInteger) hex;
@Inferis
Inferis / caveatPatchor.js
Created August 19, 2011 18:54
caveatPatcher.js inferis
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
//
// Speciaal voor @junkiesxl
// ######## YES nil N, 10000000 iterations
// 0 0.376909: if
// 0 0.456258: if-equivalent statement
// 0 0.312767: statement
// 0 0.368508: statement-equivalent ifs
// 1 0.309485: if
// 1 0.324720: if-equivalent statement
@Inferis
Inferis / UIView+RoundedOverlay.h
Created October 9, 2012 19:21
Apply a rounded overlay to a viewcontroller.
//
// UIView+RoundedOverlay.h
//
// Created by Tom Adriaenssen on 05/04/12.
//
#import <UIKit/UIKit.h>
@interface UIViewController (RoundedOverlay)
@Inferis
Inferis / CommonMacros.h
Last active February 5, 2018 03:01
Common Macros for Xcode projects.
//
// CommonMacros.h
// Created by Tom Adriaenssen (@inferis)
// Inspired by the awesome work by Piet Jaspers (@pjaspers)
//
/*
* How to use this file:
* 1. Find your .pch file
* 2. Import this file
@Inferis
Inferis / Animations.m
Created November 26, 2013 10:53
Logs "finished = 0" When I remove the changes in the animations block, finished = 1 The changes are applied, but immediately. Duration = 0.3 but setting any value does not matter.
_blurView.alpha = 0;
CGAffineTransform toTransform = _snapshotView.transform;
_snapshotView.transform = CGAffineTransformIdentity;
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
usingSpringWithDamping:0.8
initialSpringVelocity:0.2
options:UIViewAnimationOptionCurveEaseOut
animations:^{
@Inferis
Inferis / Build.h
Last active March 20, 2017 15:55
A throw at accessing build settings from within your app. * See the first comment for more info.
// Build.h
// -- autogenerated file by zettings.rb on 2013-12-10 00:09:25 +0100
#import "GeneratedBuild.h"
@interface Build : GeneratedBuild
+ (instancetype)settings;
// add properties here for custom behavior
➤ cloc .
6759 text files.
2025 unique files.
3376 files ignored.
http://cloc.sourceforge.net v 1.58 T=19.0 s (84.0 files/s, 9102.7 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Objective C 829 27043 15909 97896
### Keybase proof
I hereby claim:
* I am inferis on github.
* I am inferis (https://keybase.io/inferis) on keybase.
* I have a public key whose fingerprint is F010 B286 2F49 1AB8 484F 2211 B7CE DECA C646 8A5C
To claim this, I am signing this object:
@Inferis
Inferis / ViewController.swift
Last active December 1, 2019 23:27
Beginnings of a GCD wrapper in swift
import UIKit
import QuartzCore
class ViewController: UIViewController {
@IBOutlet weak var label: UILabel
@IBOutlet weak var counter: UILabel
override func viewDidLoad() {
super.viewDidLoad()