- 1Password
- Xcode
- bear
- homebrew
- intelliJ IDEA
- iXLIFF
- Tweetbot
- TextMate
- Gimp
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
| version: "3.8" | |
| services: | |
| db: | |
| image: mysql:latest | |
| volumes: | |
| - ./db/data:/var/lib/mysql | |
| ports: | |
| - "3306:3306" | |
| restart: always |
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
| SELECT DATE_FORMAT(FROM_UNIXTIME(`date`), '%e %b %Y %H:%m:%s') AS created, temp, humid FROM `table_name` ORDER BY id DESC LIMIT 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
| extension String { | |
| var isValidEmail: Bool { | |
| let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | |
| let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) | |
| return emailTest.evaluate(with: self) | |
| } | |
| } |
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
| class MyView: UIView { | |
| private let gradient = CAGradientLayer() | |
| override func draw(_ rect: CGRect) { | |
| super.draw(rect) | |
| gradient.colors = [UIColor.red.cgColor, UIColor.blue.cgColor] // beliebig viele Farben für den Verlauf einstellen | |
| gradient.startPoint = CGPoint(x: 0, y: 0) // über start und endPoint kann die Richtung des Verlaufes verändert werden. | |
| gradient.endPoint = CGPoint(x: 0, y: 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
| wget -qO- http://checkip.dyndns.org | sed -e 's/^.*s: //' -e 's_</b.*$__' |
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
| // find duplicates | |
| db.collection.aggregate([ | |
| { $group: { | |
| _id: { firstField: "$firstField", secondField: "$secondField" }, | |
| uniqueIds: { $addToSet: "$_id" }, | |
| count: { $sum: 1 } | |
| }}, | |
| { $match: { | |
| count: { $gt: 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
| # create archive | |
| # c: create v: verbose f: output file | |
| tar -cvf target.tar /folder | |
| # zipped: | |
| tar -czvf target.tar.gz /folder | |
| # extract archive to | |
| # folder must exist! | |
| tar -zxvf target.tar.gz -C /folder |
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
| // sepcifiy your errors | |
| enum MyCustomError : Error { | |
| case customError | |
| case missingProperty | |
| var localizedDescription: String { | |
| switch self { | |
| case .urlCouldNotBeCreated: | |
| return NSLocalizedString("MyCustomErrorCcustomError", value: "a localized error message", comment: "") | |
| case .missingProperty: |
NewerOlder