Over 10'000'000
app downloads on the App Store.
Drop me a line at rbaulin@gmail.com
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
// | |
// KeychainBehaviourTests.m | |
// | |
// Created by Roman Baulin on 25/04/2017. | |
// Copyright © 2017. All rights reserved. | |
// | |
// | |
// see SecBase.h and osstatus.com and to investigate keychain error codes | |
// |
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
@implementation NSArray (FDMapping) | |
// import, array diff | |
// https://github.com/glebd/google-toolbox-for-mac/blob/master/Foundation/GTMNSArray%2BMerge.m | |
// https://github.com/Wondermall/Doppelganger | |
// https://github.com/Basket/BKDeltaCalculator/blob/master/BKDeltaCalculator/BKDeltaCalculator.m | |
+ (void)ag_mapSourceArray:(NSArray *)source toDestArray:(NSArray *)dest sourceKey:(id (^)(id obj))sourceKeyBlock destKey:(id (^)(id obj))destKeyBlock compare:(NSComparisonResult (^)(id, id))compareBlock match:(void (^)(id, id))matchBlock { | |
NSArray *sortedSource = [source sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { |
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
- (instancetype)init | |
{ | |
self = [super initWithStyle:UITableViewStyleGrouped]; | |
if (self) { | |
} | |
return self; | |
} | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
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
#!/bin/sh | |
palette="/tmp/palette.png" | |
filters="fps=$4,scale=$3:-1:flags=lanczos" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $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
NSString *rand_str() { | |
NSString *alphabet = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXZY0123456789"; | |
u_int32_t len = arc4random_uniform(20) + 5; | |
NSMutableString *s = [NSMutableString stringWithCapacity:len]; | |
for (NSUInteger i = 0U; i < len; i++) { | |
u_int32_t r = arc4random() % [alphabet length]; | |
unichar c = [alphabet characterAtIndex:r]; | |
[s appendFormat:@"%C", c]; | |
} | |
return s; |
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
# open terminal here service | |
# works in OSX El Capitan | |
# to install create new Automator Service with Run Shell script below | |
# original script http://protips.maxmasnick.com/cdff-cd-to-the-path-of-the-front-most-finder-window | |
function ff { osascript -e 'tell application "Finder"'\ | |
-e "if (${1-1} <= (count Finder windows)) then"\ | |
-e "get POSIX path of (target of window ${1-1} as alias)"\ | |
-e 'else' -e 'get POSIX path of (desktop as alias)'\ | |
-e 'end if' -e 'end tell'; };\ |
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
// unity pc and mobile input | |
// http://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html | |
// http://docs.unity3d.com/Manual/MobileInput.html | |
void Update() { | |
if (SystemInfo.deviceType == DeviceType.Desktop) { | |
if (Input.GetMouseButtonDown(0)) {// 0 - left click, 1 - right click, 2 - middle click | |
// click | |
} |
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
var path = require('path'); | |
var express = require('express'); | |
var app = express(); | |
var openConnections = []; | |
global.emitEvent = function () { | |
console.log("emit to clients " + openConnections.length); | |
openConnections.forEach(function(res) { | |
res.write('data: event' + "\n\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
- (UIImage *)render:(CGRect)frame { | |
if (CGRectIsEmpty(frame) || CGRectIsInfinite(frame) || CGRectIsNull(frame)) { | |
return nil; | |
} | |
UIGraphicsBeginImageContextWithOptions(frame.size, NO, 0); // same as [[UIScreen mainScreen] scale] | |
// drawing code | |
// Create new image |
NewerOlder