Skip to content

Instantly share code, notes, and snippets.

View fireeflies's full-sized avatar
💭
Silence I'm sleeping (c)

Tomioka fireeflies

💭
Silence I'm sleeping (c)
  • Russia/Kursk
View GitHub Profile
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]
Windows Registry Editor Version 5.00
;--------
;-------- Remove Paint 3D Edit from context menu for image files
;--------
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.bmp\Shell\3D Edit]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.jpeg\Shell\3D Edit]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.jpe\Shell\3D Edit]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.jpg\Shell\3D Edit]
@fireeflies
fireeflies / command_line.md
Created April 10, 2025 21:37 — forked from Busyrev/command_line.md
Хинты для работы с *nix command line

Суммарный вес 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

@fireeflies
fireeflies / ObjectForKeypath.m
Created November 7, 2024 18:45 — forked from CreatureSurvive/ObjectForKeypath.m
object from json keypath
/*
* 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];
-(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"
@fireeflies
fireeflies / UIButton+SUI.m
Created November 7, 2024 18:28 — forked from 0xstragner/UIButton+SUI.m
Trigger UIMenu programmatically
//
// Created by Anton Spivak
//
#import "UIButton+SUI.h"
@import Objective;
@import ObjectiveC.runtime;
@import ObjectiveC.message;
@fireeflies
fireeflies / UIButton+SUI.m
Created November 7, 2024 18:28 — forked from 0xstragner/UIButton+SUI.m
Trigger UIMenu programmatically
//
// Created by Anton Spivak
//
#import "UIButton+SUI.h"
@import Objective;
@import ObjectiveC.runtime;
@import ObjectiveC.message;
//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];
@fireeflies
fireeflies / MBProgressHUD with Blocks.m
Created November 7, 2024 18:24 — forked from rizumita/MBProgressHUD with Blocks.m
MBProgressHUD with Blocks
#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];
});
});
@fireeflies
fireeflies / UIImageView+Block.h
Created November 7, 2024 18:22 — forked from joshdholtz/UIImageView+Block.h
iOS - UIImageView+Block
//
// 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)