Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2
#ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3
#ID='E969541F-E6F9-4D25-8158-72DC3545A6C6' # Xcode 6.3.2
ID=`/usr/libexec/PlistBuddy -c 'Print DVTPlugInCompatibilityUUID' "$(xcode-select -p)/../Info.plist"`
PLIST_BUDDY=/usr/libexec/PlistBuddy
@skeeet
skeeet / xcode-update-revision.sh
Created July 14, 2015 05:55
Update XCode build and version, based on git info
#!/bin/sh
# autoupdate-revision.sh
#
# Evgeny Aleksandrov
REV_FILE="${PROJECT_DIR}/Supporting-files/version.xcconfig"
. $REV_FILE
PROJECT_VERSION=${H_VERSION_NUMBER}
COMMITS_COUNT=`git rev-list develop | wc -l | tr -d ' '`
@skeeet
skeeet / pre-commit-clang-format
Last active August 29, 2015 14:27 — forked from wangkuiyi/pre-commit-clang-format
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by [email protected]
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@skeeet
skeeet / gist:a6130f380ddc9a07b312
Created November 23, 2015 23:27 — forked from jpiche/gist:a15e625368216eb0baa6
UIKeyboardWillChangeFrameNotification method
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillChange:)
name:UIKeyboardWillChangeFrameNotification
object:nil];
}
- (void)viewWillDisappear:(BOOL)animated
@import UIKit;
NS_ASSUME_NONNULL_BEGIN
@protocol MFBPreviewableCollectionView
- (nullable NSIndexPath *)mfb_previewableCollectionIndexPathForItemAtPoint:(CGPoint)point;
- (CGRect)mfb_previewableCollectionItemRectForIndexPath:(NSIndexPath *)indexPath;
@skeeet
skeeet / hamburger.swift
Created June 8, 2016 11:43 — forked from MrAlek/hamburger.swift
Example of how to use presentation, animation & interaction controllers w/ custom segues to create a slide-in modal menu which partially covers presenting view.
import UIKit
enum Direction {
case Left, Right, Up, Down
var pointVector: CGPoint {
switch self {
case Left: return CGPoint(x: -1, y: 0)
case Right: return CGPoint(x: 1, y: 0)
case Up: return CGPoint(x: 0, y: -1)
@skeeet
skeeet / coursera.sh
Created June 12, 2016 06:28 — forked from bburky/coursera.sh
Automatically configure a VM download Coursera courses
#!/bin/bash
# Automatically configure a VM download Coursera courses.
# This script works as a user data file for use with a cloud VM.
# This script will resume downloading if the VM is restarted.
# This script works with Debian jessie (or possibly Ubuntu with systemd).
# You must enroll in each course and accept the Honor of Code of each course
# before you can download them.
@skeeet
skeeet / set_project_profiles.sh
Created July 4, 2016 13:18 — forked from tehnoir/set_project_profiles.sh
Update Xcode project's build settings to point to current provisioning profiles.
#!/bin/bash
##############################################################################################################
### 1. Name your profiles with the convention of ProjectName_TargetName_ConfigurationName.mobileprovision ###
### 2. Create a directory called CodeSign in your project directory ###
### 3. Move all your project's provisioning profiles into the CodeSign directory ###
### ###
### Running this script will update your project file to point to the correct UUIDs of each corresponding ###
### profile in your CodeSign directory. ###
##############################################################################################################

Keybase proof

I hereby claim:

  • I am skeeet on github.
  • I am skt (https://keybase.io/skt) on keybase.
  • I have a public key whose fingerprint is 8200 3360 8AF5 28FF 1561 D73E AF1F 4F9B DB85 8720

To claim this, I am signing this object:

@skeeet
skeeet / README.md
Created July 26, 2016 06:17 — forked from andyshinn/README.md
CoreOS on Digital Ocean using Terraform

Terraform, CoreOS, and Digital Ocean

Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.

Install Terraform

Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.

Digital Ocean API Key