Skip to content

Instantly share code, notes, and snippets.

Guillaume Lessard glessard

  • Colorado, USA
Block or report user

Report or block glessard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am glessard on github.
  • I am glessard (https://keybase.io/glessard) on keybase.
  • I have a public key ASBg9FfGSW_7QAPJ-Sd1KFxbrIzz4KVj4PgcwmlUTGkR5wo

To claim this, I am signing this object:

@glessard
glessard / url-extensions.swift
Created Mar 8, 2018
Extensions that help reduce pain when building up Foundation.URL instances
View url-extensions.swift
//
// url-extensions.swift
//
// Created by Guillaume Lessard
// Copyright (c) 2018 Guillaume Lessard. All rights reserved.
//
// https://gist.github.com/glessard/a2b2916aa74f082a58d50a674174f1a4
//
import Foundation
View result-struct.swift
public struct Result<Value>
{
private let state: State<Value>
init(_ value: Value) {
state = .value(value)
}
init(_ error: Error) {
state = .error(error)
@glessard
glessard / syncprint.swift
Last active Aug 31, 2016
print, synchronized for multiple threads
View syncprint.swift
//
// syncprint.swift
//
// Created by Guillaume Lessard on 2014-08-22.
// Copyright (c) 2016 Guillaume Lessard. All rights reserved.
//
// https://github.com/glessard/syncprint
// https://gist.github.com/glessard/826241431dcea3655d1e
//
@glessard
glessard / future.swift
Last active Aug 29, 2015
Asynchronous future result in Swift. No new type.
View future.swift
//
// future.swift
//
// Created by Guillaume Lessard on 2014-11-14.
// Copyright (c) 2014 Guillaume Lessard. All rights reserved.
//
// https://gist.github.com/glessard/2abbfd76d401b1b833cc
//
import Dispatch
@glessard
glessard / shuffle.swift
Last active Jun 29, 2018
Shuffle a CollectionType
View shuffle.swift
//
// shuffle.swift
//
// Created by Guillaume Lessard on 2014-08-28.
// Copyright (c) 2016 Guillaume Lessard. All rights reserved.
//
// https://github.com/glessard/shuffle
// https://gist.github.com/glessard/7140fe885af3eb874e11
//
@glessard
glessard / DeferredTaskList.swift
Last active Aug 29, 2015
A defer keyword in Swift
View DeferredTaskList.swift
//
// defer.swift
// DeferredTaskList
//
private class DeferredTasks
{
private typealias Task = () -> ()
var list = [Task]()
You can’t perform that action at this time.