This file contains 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
awk '/^#/ {next} BEGIN {FS=":"; print "\Name\tUserID\tGroup\tHomeDirectory"} { print $1"\t"$3"\t"$4"\t"$6}' /etc/passwd |
This file contains 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
eu 1.230,23 ¤ 1.230,23 ¤¤¤ | |
hr 1.230,23 KM 1.230,23 konvertibilne marke | |
en FCFA1,230 1,230 Central African CFA francs | |
en FBu1,230 1,230 Burundian francs | |
rw RF 1.230 1.230 RWF | |
ast 1.230,23 ¤ 1.230,23 ¤¤¤ | |
en E1,230.23 1,230.23 Swazi emalangeni | |
he 1,230.23 ₪ 1,230.23 שקלים חדשים | |
ar ١٬٢٣٠٫٢٣ ¤ ١٬٢٣٠٫٢٣ ¤¤¤ | |
uz ¤ ۱٬۲۳۰٫۲۳ ۱٬۲۳۰٫۲۳ ¤¤¤ |
This file contains 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 { | |
func abbrevatedByCapitalLetters() -> String { | |
var abbrevations = [Character]() | |
for character in self.characters where String(character) == String(character).uppercased() { | |
abbrevations.append(character) | |
} | |
return String(abbrevations) | |
} | |
} |
This file contains 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
func mergeSort<T: Comparable>(inout array:[T],p: Int, r: Int) -> [T]{ | |
var p = p | |
guard r > p else{ | |
return array | |
} | |
var q = p + (r-p)/2 | |
This file contains 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
// | |
// NSManagedObject+Duplicate.h | |
// | |
// Copyright (c) 2014 Barry Allard | |
// | |
// MIT license | |
// | |
// inspiration: https://stackoverflow.com/questions/2998613/how-do-i-copy-or-move-an-nsmanagedobject-from-one-context-to-another | |
#import <CoreData/CoreData.h> |
This file contains 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
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] | |
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?: | |
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:( | |
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ | |
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 | |
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ | |
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ | |
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: | |
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z | |
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n) |
This file contains 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 UIView{ | |
func boundInside(superView: UIView){ | |
self.translatesAutoresizingMaskIntoConstraints = false | |
superView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[subview]-0-|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics:nil, views:["subview":self])) | |
superView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[subview]-0-|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics:nil, views:["subview":self])) | |
} |
This file contains 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
IFS=$'\n' | |
function tagAllIcons(){ | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
APP_ICONS_PATH="${PROJECT_DIR}/BuildNumberTagger/Images.xcassets/AppIcon.appiconset" | |
REFERENCE_ICONS_PATH="${PROJECT_DIR}/BuildNumberTagger/AppIconReference.xcassets" | |
for ICON_PATH in $(find ${REFERENCE_ICONS_PATH} -name "*Icon*.png") |
This file contains 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
//Define a class Cat | |
class Cat { | |
} | |
enum EnumWithRaw : Cat{ | |
/* | |
INVALID | |
[Error]: Raw Type Cat is not convertible from any literal | |
[Reason]: Raw value of enum have to be of type strings, characters, or any of the integer or floating-point number types. |
This file contains 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
MODEL_PATH="$PROJECT_DIR/<RootDirectory>/<ModelName>.xcdatamodeld" | |
OUTPUT_DIRECTORY="$PROJECT_DIR/<RootDirectory>/Classes/Model" | |
mogenerator --v2 --model $MODEL_PATH --output-dir $OUTPUT_DIRECTORY |
NewerOlder