Skip to content

Instantly share code, notes, and snippets.

@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 29, 2024 14:26
Swift Concurrency Manifesto
@MightyPork
MightyPork / usb_hid_keys.h
Last active June 30, 2024 10:41
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@kharmabum
kharmabum / ocmock-cheatsheet.m
Last active October 8, 2022 07:55
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@natecook1000
natecook1000 / NSTimer+Closure.swift
Last active January 6, 2024 07:23
Scheduled NSTimer with a Swift closure
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
*/
@eternalstorms
eternalstorms / iCloud.txt
Created September 20, 2012 09:52
iCloud file sync step by step
1) Turn on iCloud in your entitlements. In Xcode, you can find 'em in your target, under the Summary tab, at the bottom. Turn on 'Enable Entitlements' and press + on the iCloud Containers list.
2) You get a folder. Stuff in it gets synchronized around. This is the easy part. You can use the -[NSFileManager URLForUbiquityContainerIdentifier:] call to find out where the container is.
Extra notes: The identifier is whatever name Xcode added to the list in step 1. Make sure you call this at least once, because calling this turns on all the iCloud stuff in Foundation. If iCloud is turned off, this will return nil.
3) This folder is organized like a home folder. Yep, this means this one can have a Documents folder, a Library, whatever. You have to create those folders if you want to use them.
4) Looking at the folder directly is not useful. (Some of the files may not have sync'd yet, so they're not yet in the folder.) Use NSMetadataQuery. This will give you all files, including those not downloaded yet.
To searc

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods