Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block adauguet

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
adauguet / FrenchPhoneNumber.elm
Last active Mar 6, 2019
French phone number validation
View FrenchPhoneNumber.elm
module Phone exposing (phoneParser)
import Parser exposing ((|.), (|=), Parser, Step(..), andThen, chompWhile, end, getChompedString, loop, oneOf, problem, run, succeed, symbol)
-- French phone number validation
-- This code makes sure that the phone number has one of the following prefixes: 0033 | +33 | 0.
-- This is only used for validation purposes so the prefix is not retained.
-- source
View UIColor+Hex.swift
import UIKit
extension Int {
init?(hexString: String) {
let string = hexString.replacingOccurrences(of: "#", with: "")
self.init(string, radix: 16)
var rgb: (red: Int, green: Int, blue: Int) {
let red = self >> 16 & 0xff
You can’t perform that action at this time.