Skip to content

Instantly share code, notes, and snippets.

View revolter's full-sized avatar

iulianOnofrei (U-lee-aan) revolter

View GitHub Profile
protocol RegularExpressionMatchable {
func match(regex: NSRegularExpression) -> Bool
}
extension String: RegularExpressionMatchable {
func match(regex: NSRegularExpression) -> Bool {
let range = NSMakeRange(0, self.count)
let matches = regex.numberOfMatches(in: self, range: range)
return matches > 0
@revolter
revolter / multihooks.py
Last active October 6, 2017 20:38 — forked from carlos-jenkins/multihooks.py
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#