Skip to content

Instantly share code, notes, and snippets.

View vfn's full-sized avatar
💭
👀

Virgilio Favero Neto vfn

💭
👀
View GitHub Profile
@vfn
vfn / CanBeEmpty.swift
Created November 6, 2019 23:15
Swift utils
public protocol CanBeEmpty {
var isEmpty: Bool { get }
var isNotEmpty: Bool { get }
var nilIfEmpty: Self? { get }
}
public extension CanBeEmpty {
/// Returns nil if empty, otherwise returns self
@vfn
vfn / keybase.md
Created September 12, 2019 12:11
keybase prove github vfn

Keybase proof

I hereby claim:

  • I am vfn on github.
  • I am vneto (https://keybase.io/vneto) on keybase.
  • I have a public key ASBn3_Ov8HrLB3NmwDrnGDBUPx3Qo75Lhk5saXWd6KrhFgo

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import Foundation
// Based on http://oleb.net/blog/2015/12/lazy-properties-in-structs-swift/
final class LazyBox<T> {
init(computation: () -> T) {
self.lazyValue = .NotYetComputed(computation)
}
@vfn
vfn / Podfile
Last active August 29, 2015 14:23
Podfile post hook
post_install do |installer_representation|
workDir = Dir.pwd
xcconfigFilesPath = "#{workDir}/Pods/Target Support Files/Pods/Pods.*.xcconfig"
xcconfigFiles = Dir[xcconfigFilesPath]
xcconfigFiles.each do |xcconfigFilename|
next if File.directory? xcconfigFilename
puts "----------- Post hook will modify #{xcconfigFilename}"
#!/bin/sh
~/Applications/UniversalIndentGUI/indenters/uncrustify -l OC -q -c ~/Applications/UniversalIndentGUI/config/uncrustify_obj_c.cfg