Skip to content

Instantly share code, notes, and snippets.

View xxKRASHxx's full-sized avatar
🐺

Daniel Lisovoy xxKRASHxx

🐺
View GitHub Profile
@calda
calda / SortDescriptor.swift
Created July 20, 2018 00:45
SortDescriptor.playground
import Foundation
// MARK: SortDescriptor
/// Type-erased Sort Descriptor (can store multiple in the same array
/// regardless of the underlying KeyPath
public struct SortDescriptor<Element> {
private let comparator: (Any, Any) -> Bool
@cecilemuller
cecilemuller / launch.json
Last active May 16, 2024 16:38
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@shu223
shu223 / CustomActivity.swift
Last active November 4, 2020 17:59
Custom UIActivity in Swift 3
import UIKit
class CustomActivity: UIActivity {
override class var activityCategory: UIActivityCategory {
return .action
}
override var activityType: UIActivityType? {
guard let bundleId = Bundle.main.bundleIdentifier else {return nil}
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote