Just trying to see how Rust patterns work in Swift
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
// Returns true iff the string is non-nil and contains at least one non-whitespace character | |
CG_INLINE BOOL MVNonEmptyString(NSString * _Nullable string) { | |
if([string isKindOfClass:NSAttributedString.class]) { | |
string = ((NSAttributedString*)string).string; | |
} | |
NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; | |
NSUInteger len = string.length; | |
for (NSUInteger i = 0; i < len; i++) { | |
unichar c = [string characterAtIndex:i]; | |
if (![whitespace characterIsMember:c]) { |
I hereby claim:
- I am igor-makarov on github.
- I am igormaka (https://keybase.io/igormaka) on keybase.
- I have a public key ASCJjVe9FXxTp6ld6JUfiCZOEoaF09-wTGxEGrdOWMGEOQo
To claim this, I am signing this object:
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 ruby | |
require 'pathname' | |
require 'set' | |
require 'tempfile' | |
dir = File.dirname(__FILE__) | |
file = ARGV[1] || "#{dir}/../../SharedModules/Styling/UIImage-Generated.swift" | |
files = Dir["#{Dir.pwd}/Moovit/**/*.{png,pdf,jpg}"] + Dir["#{Dir.pwd}/Flavors/*/WLASlices.xcassets/**/*.{png,pdf,jpg}"] |
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
12:20:34 PM: Build ready to start | |
12:20:35 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63 | |
12:20:35 PM: build-image tag: v3.3.2 | |
12:20:35 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0 | |
12:20:36 PM: Fetching cached dependencies | |
12:20:36 PM: Starting to download cache of 746.8MB | |
12:20:39 PM: Finished downloading cache in 3.621019082s | |
12:20:39 PM: Starting to extract cache | |
12:21:33 PM: Finished extracting cache in 53.749542741s | |
12:21:33 PM: Finished fetching cache in 57.743154452s |
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 ruby | |
fastlane_require 'rest-client' | |
fastlane_require 'json' | |
fastlane_require 'pathname' | |
fastlane_require 'fileutils' | |
fastlane_require 'spaceship' | |
fastlane_require 'sigh' | |
fastlane_require 'sigh/download_all' | |
fastlane_require 'fabricate' |
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
cp -R Peer5Kit/build/Release-iphoneos/Peer5Kit.framework . | |
lipo Peer5Kit/build/Release-iphoneos/Peer5Kit.framework/Peer5Kit Peer5Kit/build/Release-iphonesimulator/Peer5Kit.framework/Peer5Kit -create -output Peer5Kit.framework/Peer5Kit |
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 | |
import Buglife | |
import Log4swift | |
class BuglifeLogAppender: Log4swift.Appender { | |
override public func performLog(_ log: String, level: LogLevel, info: LogInfoDictionary) { | |
var lifeLogType: LIFEAwesomeLogType | |
switch level { | |
case .Trace, .Debug, .Off: | |
lifeLogType = .debug |