Skip to content

Instantly share code, notes, and snippets.

View thomaswhyyou's full-sized avatar

Thomas thomaswhyyou

View GitHub Profile
@thomaswhyyou
thomaswhyyou / gist:556d4332731c369619390e716ad8990d
Created May 15, 2016 17:20
Unlabel BookClub : Requirements for book suggestions
Only a few considerations when making book suggestions:
* No fiction;
* Any book/topic that you are interested in reading; *AND*
* At minimum tangentially related/instructive to the work you do everyday.
(Preferably in the "maker" context, for the lack of better term.
i.e. Product/design/development/management/startup/marketing/etc.)
The goal is to read and learn together, whatever the topic is; get better everyday, collectively.
:)
@thomaswhyyou
thomaswhyyou / gist:6e2a2b2315afe0d955a7
Created November 27, 2015 22:05 — forked from akolosov/gist:cedaac86b333a4ced95f
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
hg clone https://code.google.com/p/vim/
@thomaswhyyou
thomaswhyyou / gist:7aa92f746514d91b016c
Last active August 29, 2015 14:27
Disable Sketch 3 auto-save
defaults write com.bohemiancoding.sketch3 ApplePersistence -bool no
" ================ Vundle Config ======================
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
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:

@thomaswhyyou
thomaswhyyou / gist:a20483bc19918f287e67
Created February 13, 2015 04:22
sphinx read the doc pygments css
.code {background-color:#f8f8f8;}
/*Manually copied & pasted from http://docs.readthedocs.org/en/latest/*/
.code .hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}
.code .c{color:#998;font-style:italic}
.code .err{color:#a61717;background-color:#e3d2d2}
.code .k{font-weight:bold}
.code .o{font-weight:bold}
.code .cm{color:#998;font-style:italic}
.code .cp{color:#999;font-weight:bold}
.code .c1{color:#998;font-style:italic}
Verifying that +thomaswhyyou is my openname (Bitcoin username). https://onename.com/thomaswhyyou