Skip to content

Instantly share code, notes, and snippets.

View zakol's full-sized avatar

Dawid Żakowski zakol

View GitHub Profile
@zakol
zakol / mapFlattenToTree.js
Last active May 10, 2018 14:55
[JS] Map flatten array to tree
import _ from 'lodash';
const originKey = '__origin';
const traverseTree = (root, test) => {
let stack = [root];
while (stack.length > 0) {
const node = stack.pop();
@zakol
zakol / gist:82798fc51a0277563eea
Created January 23, 2015 09:02
Custom color for iOS status bar text
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
@interface UIStatusBar : NSObject @end
@implementation UIStatusBar (CustomColor)
+ (void)load
{
static dispatch_once_t onceToken;
+ (dispatch_block_t)performBlock:(void (^)(dispatch_block_t safeBlock))block
{
dispatch_block_t strongBlock;
__weak __block dispatch_block_t weakBlock = strongBlock = ^{
block(weakBlock);
};
strongBlock();
return strongBlock;
}