Skip to content

Instantly share code, notes, and snippets.

@ehuynh
ehuynh / swift-cheat-sheet.md
Last active February 23, 2018 08:31
Swift Cheat Sheet

Basic

Integers

Int

In most cases, you don't need to pick a specific size of integer to use in your code. Swift provides an integer type, Int, which has the same size as the current platform's native word size:

  • On a 32bit platform, Int is the same size as Int32
  • On a 64bit platform, Int is the same size as Int64
@ehuynh
ehuynh / prepare-commit-msg
Last active June 3, 2021 10:45
prepare-commit-msg hook for populating commit message template with the JIRA ticket number as a prefix
#!/bin/sh
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
SHA1=$3
#/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"
# Include any branches for which you wish to disable this script
if [ -z "$BRANCHES_TO_SKIP" ]; then