Skip to content

Instantly share code, notes, and snippets.

View jamielesouef's full-sized avatar

Jamie Le Souef jamielesouef

  • Melbourne, Australia
View GitHub Profile
@jamielesouef
jamielesouef / .zshrc
Created July 3, 2018 03:14
My .zshrc
export ZSH=/Users/jlesouef/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git)
source $ZSH/oh-my-zsh.sh
source ~/Developer/zsh-git-prompt/zshrc.sh
# an example prompt
@jamielesouef
jamielesouef / xcode-build-bump.sh
Created May 4, 2016 21:59 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
// UIColor(hex: 0xFF0000)
extension UIColor {
convenience init(hex: Int) {
let components = (
R: CGFloat((hex >> 16) & 0xff) / 255,
G: CGFloat((hex >> 08) & 0xff) / 255,
B: CGFloat((hex >> 00) & 0xff) / 255
)
extension UIColor {
static func Random() -> UIColor {
let r:CGFloat = CGFloat(drand48())
let g:CGFloat = CGFloat(drand48())
let b:CGFloat = CGFloat(drand48())
return UIColor(red: r, green: g, blue: b, alpha: 1.0)
}
}
@jamielesouef
jamielesouef / autolayout_demo.swift
Created July 29, 2015 05:42
vertical center and equal space autolayout
import UIKit
import XCPlayground
let buttonSize:CGFloat = 30
let viewHeight:CGFloat = 90
let viewWidth:CGFloat = 300
var view = UIView()
view.frame = CGRect(x: 0, y: 0, width: viewWidth, height: viewHeight)
view.backgroundColor = UIColor.grayColor()
FOR ACTION SEND
⌘← "HEX CODE" 0x01
⌘→ "HEX CODE" 0x05
⌥← "SEND ESC SEQ" b
⌥→ "SEND ESC SEQ" f
@jamielesouef
jamielesouef / gist:ce8ccefa2a3126b7d7a2
Last active August 29, 2015 14:21
unwinding a segue : prepareForSegue
// put this in your "from" view controller"
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "toHomeView" {
let destinationViewController = segue.destinationViewController as! HomeViewController;
// setup the destination controller
}
}
@jamielesouef
jamielesouef / gist:2af13a2177ce9198b9e4
Last active August 29, 2015 14:21
Unwind Storyboard Segue
// put this in your 'to' view controller
@IBAction func unwindSegue(segue: UIStoryboardSegue) {
// do stuff
}
@jamielesouef
jamielesouef / .bash_profile
Last active December 14, 2015 10:46
Ever growing .bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
#brew install bash-git-prompt
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
fi
@jamielesouef
jamielesouef / .gitconfig
Last active April 15, 2021 03:35
Git Alias
[core]
editor = code --wait
excludesfile = ~/.gitignore_global
[fetch]
prune = true
[alias]
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b