Skip to content

Instantly share code, notes, and snippets.

View kristofk's full-sized avatar

Kristof Kocsis kristofk

View GitHub Profile
@kristofk
kristofk / git_create_orphan.sh
Last active April 22, 2018 12:07 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo
# Prepare branch
cd repository
git checkout --orphan <orphan-name>
git rm -rf .
rm '.gitignore'
# Create a commit (this can be empty) and push
git commit --allow-empty -m “root commit”
git push origin orphan_name
@kristofk
kristofk / UIImage+PixelColor.swift
Created June 17, 2017 13:59 — forked from marchinram/UIImage+PixelColor.swift
iOS Swift UIImage subscript extension to get pixel color
import UIKit
extension UIImage {
subscript (x: Int, y: Int) -> UIColor? {
if x < 0 || x > Int(size.width) || y < 0 || y > Int(size.height) {
return nil
}