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 Locale { | |
var flagEmoji: String? { | |
let base: UInt32 = 127397 | |
return countryCode? | |
.unicodeScalars | |
.compactMap { Unicode.Scalar(base + $0.value) } | |
.reduce("", { $0.appending(String($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
~/.gitconfig | |
[user] | |
name = Personal Name | |
email = [email protected] | |
[includeif "gitdir:~/Projects/Company/"] | |
path = Projects/Company/gitconfig-company |
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 Foundation | |
public class Promise<T> { | |
public private(set) lazy var future: Future<T> = Future() | |
public init() { /**/ } | |
public func fulfill(_ value: T) { | |
future.result = .success(value) |
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 UIKit | |
public protocol DynamicContentTransitinable { | |
func layoutContentOnscreen() | |
func layoutContentOffscreen() | |
} | |
public class DynamicContentTransitioner: NSObject, UIViewControllerAnimatedTransitioning { | |
var animationDuration: TimeInterval |
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 UIKit | |
open class ZoomImageView: UIScrollView, UIScrollViewDelegate { | |
// MARK: Publics | |
public enum ZoomMode { | |
case fit | |
case fill |
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
#!/bin/sh | |
PS3='Type the number of your choice (1, 2 or 3) and press Enter: ' | |
options=("List Devices" "Run Simulator" "Quit") | |
select opt in "${options[@]}" | |
do | |
case $opt in | |
"List Devices") | |
xcrun simctl list devices | |
echo "\033[1m\n\nCopy the UDID in parentheses of the device which you want run and launch option 2 (Run Simulator)\033[0m" | |
;; |
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
#!/bin/bash | |
dbus-launch dropbox start -i |
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
- (void)validateRenewablePurchases:(NSArray<NSString *> *)products callback:(void (^)(NSDictionary *values, NSString *errorMessage))callback | |
{ | |
// Sending into background | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ @autoreleasepool{ | |
void (^callbackOnMainThread)(NSDictionary *values, NSString *errorMessage) = ^(NSDictionary *values, NSString *errorMessage) { | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
callback(values, errorMessage); | |
}); | |
}; |
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
[Desktop Entry] | |
Name=Viber | |
Comment=Viber VoIP and messenger | |
Exec=env XDG_CURRENT_DESKTOP=Unity /opt/viber/Viber | |
Icon=/usr/share/pixmaps/viber.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Network;Application; | |
Path= |
NewerOlder