This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import time | |
| regex = r"\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+" | |
| for test_str in ["firstname.lastname@example-domain.com", "firstname.lastname@example-domain.c"]: | |
| print('starting matching') | |
| start_time = time.time() | |
| matches = re.finditer(regex, test_str, re.MULTILINE) | |
| for matchNum, match in enumerate(matches, start=1): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import time | |
| import os | |
| def blink(timeout): | |
| _token = os.environ['MIRO_TOKEN'] | |
| # https://developers.miro.com/reference/update-card-item | |
| # example: https://miro.com/app/board/uXjVN7_WbKE=/?moveToWidget=3458764586820469221&cot=14 | |
| board_id = "uXjVN7_WbKE=" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # xcode-icon-tag.sh | |
| # The MIT License (MIT) | |
| # | |
| # Copyright (c) <2015> <Valerio Mazzeo> | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # | |
| # Having multiple git remotes in sync with one `push` | |
| # via: https://gist.github.com/rvl/c3f156e117e22a25f242 | |
| # | |
| set -e | |
| NEW_REPO_URL=<NEW_REPO_URL> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pat = "(^\\w)[\\w]+[\\. ]?(^\\w)?[\\w]+" // FIXME: does not catch the 2nd initial 🙁 | |
| let emails = ["john@foo.com", "john.doe@foo.com", "John Doe"] | |
| let regex = try! NSRegularExpression(pattern: pat, options: []) | |
| emails.forEach { (email) in | |
| let matches = regex.matches(in: email, options: [], range: NSRange(location: 0, length: email.count)) | |
| var initials = "" | |
| for m in matches { | |
| let firstChar = m.range(at: 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###### one of the first build phases | |
| #Update build number with number of git commits if in release mode | |
| buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ') | |
| flag="" | |
| if [ ! ${CONFIGURATION} == "Release" ]; then | |
| flag="b" | |
| fi; | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber$flag" "${INFOPLIST_FILE}" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum FormSection: Int { | |
| case Header, Section1, Section2, Section2, Section3, Summary | |
| static let identifiers = [ | |
| Header: "header", | |
| Section1: "s1", | |
| Section2: "s2", | |
| Section3: "s3", | |
| Summary: "summary" | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Playground - noun: a place where people can play | |
| import Foundation | |
| // an example list of device languages | |
| let deviceLocales = ["DE", "GB", "SE", "no_NB", "DA", "FR", "PL", "MK"] | |
| // this comes from the APIs city list | |
| let countryCodes = ["DE", "GB", "US", "SE", "DK", "JP"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.m | |
| // POSIXmyAss | |
| // | |
| // Created by Carsten Witzke on 12.09.13. | |
| // | |
| #import <Foundation/Foundation.h> | |
| int main(int argc, const char * argv[]) |
NewerOlder