Skip to content

Instantly share code, notes, and snippets.

View beefon's full-sized avatar
🕳️
Veridis Quo

Vladislav Alekseev beefon

🕳️
Veridis Quo
View GitHub Profile
@beefon
beefon / .zshrc
Last active March 2, 2020 12:53
removeDerivedData PROJECT_NAME
setopt extended_glob
removeDerivedData() {
local project_name=$1
if [[ -z "$project_name" ]]
then
rm -rf ~/Library/Developer/Xcode/DerivedData/*/^Index
else
rm -rf ~/Library/Developer/Xcode/DerivedData/"$project_name"*/^Index
fi
@beefon
beefon / operationqueue_with_urlsession_no_activity.swift
Last active February 3, 2020 08:21
NSOperationQueue + NSURLSession = no network activity
import Dispatch
import Foundation
// If you run this playground, you will never see `Request feedback` message in console.
let queue = OperationQueue()
// but if you uncomment the line below, it suddenly starts working great
// queue.maxConcurrentOperationCount = 63
// but if you set maxConcurrentOperationCount to 64, it stops working again
{
"entries": [{
"testsToRun": [],
"testDestination": {
"deviceType": "iPhone 7",
"runtime": "11.3"
},
"numberOfRetries": 5,
"environment": {
"SOME_ENV": "it will be available in tests via ProcessInfo.processInfo.environment"
{
"entries": [{
"testsToRun": [],
"testDestination": {
"deviceType": "iPhone 7",
"runtime": "11.3"
},
"numberOfRetries": 5,
"environment": {
"SOME_ENV": "it will be available in tests via ProcessInfo.processInfo.environment"
@beefon
beefon / README.md
Last active March 17, 2023 07:48 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.14)

Have a look at load.sh file below, it contains all necessary commands to automate the process of changing system limits.

This guide has been tested on macOS High Sierra and Mojave. If you'd like to learn a theory, please continue reading.

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

_The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine

FIRST:
brew install vcprompt
.bashrc:
# colors
DULL=0
BRIGHT=1
@beefon
beefon / Sample.m
Created November 11, 2014 20:54
This small sample shows you the difference between CoreAnimation and timer-based animations. Whenever main thread is blocked, timer-based animation stutters, while CA continues to render. More info https://medium.com/@beefon
@interface ViewController ()
@property (nonatomic, strong) UIView *caView;
@property (nonatomic, strong) UIView *timerView;
@property (nonatomic, assign) NSTimeInterval start;
@end
@implementation ViewController
@beefon
beefon / gist:4538704
Created January 15, 2013 13:39
Вот как я юзаю BFImage.
NSImage *backgroundImage = [[NSImage imageNamed:@"PopoverBackgroud.png"] stretchableImageWithEdgeInsets:[self backgroundImageInsets]];
NSImageView *backgroundImageView = [[NSImageView alloc] initWithFrame:contentRect];
backgroundImageView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
backgroundImageView.imageScaling = NSImageScaleAxesIndependently;
backgroundImageView.image = backgroundImage;
[_positioningWindow.contentView addSubview:backgroundImageView];
[backgroundImageView release];