Skip to content

Instantly share code, notes, and snippets.

View parrotbait's full-sized avatar

Eddie Long parrotbait

View GitHub Profile
@parrotbait
parrotbait / migrate_git.y
Created August 25, 2017 16:20
Little utility to migrate a git repo from one remote to another (from Bitbucket to Github in this case)
#!/usr/bin/env python
import platform
import os
import sys
import io
import getopt
import subprocess
import shutil
@parrotbait
parrotbait / fixDetachedHeads.py
Created August 25, 2017 16:41
Git has an unfortunate habit of detaching heads every time you change branches on the top level repo. This script goes through all the submodules and looks for a commit on a branch that matches the current hash of that branch. If it finds it it does a checkout on the branch. NOTE: this isn't foolproof, if there are multiple branches with the sam…
#!/usr/bin/env python
import platform
import os
import sys
import io
import subprocess
BASE_DIR = os.getcwd()
print("" + BASE_DIR)
@parrotbait
parrotbait / UniqueNos.swift
Created January 17, 2019 11:16
Algorithm to determine if a string has all unique characters. What if you cannot use any additional data structures?
import UIKit
// This code is based on implementing the following:
// Implement an algorithm to determine if a string has all unique characters. What if you cannot use any additional data structures?
extension Character {
func toString() -> String {
return String(self)
}
}
@parrotbait
parrotbait / gist:a2b632a057a98f05230e554b11a6c590
Last active January 18, 2019 17:01
Some good iOS Dev Accounts to follow
@parrotbait
parrotbait / Best UIView Extension
Created April 3, 2019 17:26
Add basic missing functionality to UIKit
extension UIView {
var isVisible: Bool {
set {
self.isHidden = !newValue
}
get {
return !self.isHidden
}
}
}