Skip to content

Instantly share code, notes, and snippets.

View McNight's full-sized avatar
:shipit:
Focusing

Adam McNight McNight

:shipit:
Focusing
View GitHub Profile
@McNight
McNight / keybase.md
Created April 9, 2014 21:50
Keybase

Keybase proof

I hereby claim:

  • I am McNight on github.
  • I am mcnight (https://keybase.io/mcnight) on keybase.
  • I have a public key whose fingerprint is 8106 3ED0 5D51 7480 DEEF 3C00 2C6B ED80 8831 7E3A

To claim this, I am signing this object:

@McNight
McNight / Contacts.swift
Last active November 27, 2015 11:02
Uppercase all contacts family names
// A Twitter guy requested a way to update all his contacts family names to be uppercased
// So, I wanted to give a try to the all new iOS 9 Contacts framework
// I'm a Swift noob, I didn't even finish reading the Swift book (I'm at p. 302 :D)
import Contacts
let store = CNContactStore()
store.requestAccessForEntityType(.Contacts) { success, formerError in
@McNight
McNight / .vimrc
Last active March 2, 2018 21:18
My .vimrc
" Keys
let mapleader="," " leader is comma
set backspace=2 " make backspace work like most other programs
" Vim Plug
if has('nvim')
call plug#begin('~/.local/share/nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
@McNight
McNight / static.swift
Created April 19, 2020 21:27
Hashable's StaticString
import Foundation
extension StaticString: Equatable {
public static func == (lhs: StaticString, rhs: StaticString) -> Bool {
let lp = UnsafeRawPointer(lhs.utf8Start).assumingMemoryBound(to: Int8.self)
let rp = UnsafeRawPointer(rhs.utf8Start).assumingMemoryBound(to: Int8.self)
return strcmp(lp, rp) == 0
}