Skip to content

Instantly share code, notes, and snippets.

View thomaswhyyou's full-sized avatar

Thomas thomaswhyyou

View GitHub Profile
2012-12-27 12:27:35.942 DayTwentyFour[20082:c07] initWithCoder
2012-12-27 12:27:35.947 DayTwentyFour[20082:c07] loadView
2012-12-27 12:27:35.949 DayTwentyFour[20082:c07] viewDidLoad
2012-12-27 12:27:35.949 DayTwentyFour[20082:c07] viewWillAppear
2012-12-27 12:27:35.952 DayTwentyFour[20082:c07] viewWillLayoutSubviews
2012-12-27 12:27:35.952 DayTwentyFour[20082:c07] viewDidLayoutSubviews
2012-12-27 12:27:35.956 DayTwentyFour[20082:c07] viewDidAppear
#import <UIKit/UIKit.h>
@interface UIView (StringTagAdditions)
@property (nonatomic, copy) NSString *stringTag;
@end

Swift Don'ts

  • Don't add code cruft. Avoid parentheses around conditions in if-statements or with the return keyword. Don't add semicolons except where syntactically demanded in statements or to separate statements on the same line.
  • Don't use ALL_CAPS; use camelCase
  • Don't fight type inference. Use enumeration prefixes, self-references, and class names (with constructors) only when necessary or to clarify coding intent.
  • Don't use var when let is appropriate, especially for properties. The compiler better optimizes let statements for items whose values will not change during their lifetime. For example, Apple writes, "It is good practice to create immutable collections in all cases where the collection does not need to change. Doing so enables the Swift compiler to optimize the performance of the collections you create."
  • Don't use classes when structs will do. Use class

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

# download opencv first
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
@thomaswhyyou
thomaswhyyou / .gitignore
Last active August 29, 2015 14:08 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content