Skip to content

Instantly share code, notes, and snippets.

View igor-makarov's full-sized avatar
🚌
Hi, I'm using GitHub!

Igor Makarov igor-makarov

🚌
Hi, I'm using GitHub!
View GitHub Profile

Just trying to see how Rust patterns work in Swift

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// 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]) {

Keybase proof

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:

#!/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}"]
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
@igor-makarov
igor-makarov / Fastfile
Created July 1, 2019 05:35
Spaceship legacy API usage
#!/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'
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
@igor-makarov
igor-makarov / Bash Scripts.md
Last active January 28, 2022 12:14
Bash scripts

My bash scripts

Usage

Add the following line to to .bashrc or .bash_profile:

if ! [ -d ~/.bash_scripts ]; then
    git clone https://gist.github.com/9722ca35e703f0024a4842244d258ffa.git .bash_scripts
    git -C ~/.bash_scripts branch -u origin/master
fi
source ~/.bash_scripts/bash-scripts.sh
@igor-makarov
igor-makarov / BuglifeLogAppender.swift
Created January 8, 2017 10:19
Log4swift Appender for Buglife
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