Суммарный вес png в мегабайтах, рекурсивно
find . -type f -iname \*.png -ls | awk '{a+=$7}END{print a/1024/1024}'
Суммарная площадь png в мегапикселях, рекурсивно
find . -type f -iname \*.png | xargs file | awk '{a+=$5*$7}END{print a/1024/1024}'
Количество png, рекурсивно
find . -type f -iname \*.png | wc -l
Скопировать все png в отдельное место, рекурсивно
find . -type f -iname "*.png" -exec cp {} ./pngs \;
выбрать самый большой png по размеру
find . -type f -iname \*.png -printf "%s\t%p\n" | sort -n | tail -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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PeerDistSvc] | |
"Start"=dword:00000004 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagsvc] | |
"Start"=dword:00000004 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache] | |
"Start"=dword:00000004 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GraphicsPerfSvc] | |
"Start"=dword:00000004 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AppVClient] |
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
/* | |
* usage: | |
* [self objectForKeypath:@"someKey.3.someNestedKey.2" inJSON:myJSONObject]; | |
*/ | |
- (id)objectForKeypath:(NSString *)keypath inJSON:(NSData *)json { | |
if (!keypath || !json) {return nil;} | |
__block NSInteger depth = 0; | |
NSArray *keys = [keypath componentsSeparatedByString:@"."]; | |
id result = [NSJSONSerialization JSONObjectWithData:json options:kNilOptions error:nil]; |
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
-(id)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath { | |
return [self getRowActions:tableView indexPath:indexPath]; | |
} | |
-(id)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
return [self getRowActions:tableView indexPath:indexPath]; | |
} | |
-(id)getRowActions:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath { | |
if (@available(iOS 11, *)) { | |
UIContextualAction *delete = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive | |
title:@"DELETE" |
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
//Recreate a partial route from server response, usefull in case of crash or other | |
+(void)recreateRouteFromCurrentServerRoute:(void (^)(WZRoute *))handler | |
{ | |
//Ask the server if the current user have a route to take action for | |
DMRESTRequest *request = [[DMRESTRequest alloc]initWithMethod:@"GET" ressource:@"routes/current" parameters:nil shouldEscapeParameters:NO]; | |
[request executeBlockRequest:^(NSURLResponse *response, NSData *data, NSError *error){ | |
if (data) { | |
NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:data | |
options:NSJSONReadingMutableLeaves | |
error:nil]; |
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
#if NS_BLOCKS_AVAILABLE | |
- (void)showWhileExecutingBlock:(void (^)())block animated:(BOOL)animated { | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { | |
block(); | |
dispatch_async(dispatch_get_main_queue(), ^(void) { | |
[self cleanUp]; | |
}); | |
}); | |
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
// | |
// UIImageView+Block.h | |
// | |
// Created by Josh Holtz on 5/17/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIImageView (Block) |
NewerOlder