Skip to content

Instantly share code, notes, and snippets.

@emotality
emotality / duplicate_line_xcode.md
Last active January 24, 2025 13:49
Xcode - Duplicate Line key binding

NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:

New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)


Xcode line duplicate

Bind keys to duplicate lines in Xcode

@emaloney
emaloney / guard-closure.md
Last active August 1, 2023 00:24
A simplified notation for avoiding the weak/strong dance with closure capture lists

Simplified notation for avoiding the [weak self]/strongSelf dance with closures

  • Proposal: TBD
  • Author: Evan Maloney
  • Status: Draft
  • Review manager: TBD

Introduction

Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:

@vlaminck
vlaminck / Swift.gitignore
Last active November 7, 2015 14:18
The .gitignore file that I use for Swift projects. Requires Github's Swift.gitignore file to be added to the top. https://github.com/github/gitignore/blob/master/Swift.gitignore
# Everything above should be copy/pasted from https://github.com/github/gitignore/blob/master/Swift.gitignore
# Everything else should be added below
# Eclipse
.classpath
.project
.settings/
# Intellij
@brpowell
brpowell / romsync.py
Last active March 28, 2023 23:40
Dropbox ROM syncing
# - write token and cursor to .romsync
# * update cursor every delta check
# * config file format
# token=token_string
# cursor=cursor_string
# db_roms=path_to_dropbox_roms
# local_roms=path_to_local_roms
# * upload new config to dropbox
import os