Skip to content

Instantly share code, notes, and snippets.

Andrew Podkovyrin podkovyrin

Block or report user

Report or block podkovyrin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@podkovyrin
podkovyrin / ImageCache.swift
Created Jan 10, 2020
Simple Image Cache (memory & disk)
View ImageCache.swift
//
// ImageCache.swift
// TwoFAuth
//
// Created by Andrew Podkovyrin on 8/8/19.
// Copyright © 2019 2FAuth. All rights reserved.
//
// Based on https://github.com/SDWebImage/SDWebImage/blob/master/SDWebImage/Core/SDImageCache.m
@podkovyrin
podkovyrin / ViewControllerLifecycleBehavior.swift
Created Sep 6, 2019
AOP-Style UIViewController lifecycle management
View ViewControllerLifecycleBehavior.swift
import UIKit
protocol BehaviorableViewController {
var behaviors: [ViewControllerLifecycleBehavior] { get }
}
protocol ViewControllerLifecycleBehavior {
func afterLoading(_ viewController: UIViewController)
func beforeAppearing(_ viewController: UIViewController)
@podkovyrin
podkovyrin / podkovyr_btt.json
Last active Jan 29, 2020 — forked from vas3k/vas3k_btt_v2.json
BetterTouchTool Preset
View podkovyr_btt.json
{
"BTTPresetName" : "podkovyr-btt-preset",
"BTTPresetUUID" : "4DA9BBE8-9392-4B6C-A22B-AAF8189CE7C1",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},
View keybase.md

Keybase proof

I hereby claim:

  • I am podkovyrin on github.
  • I am podkovyrin (https://keybase.io/podkovyrin) on keybase.
  • I have a public key whose fingerprint is BE95 CA3D BD37 96F3 2515 E811 8C3C AF7D D25E D3CD

To claim this, I am signing this object:

@podkovyrin
podkovyrin / CMSampleBufferRef_to_vImage.m
Last active May 30, 2018
CMSampleBufferRef to vImage and resize
View CMSampleBufferRef_to_vImage.m
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
CVPixelBufferLockBaseAddress(imageBuffer,0);
size_t height = CVPixelBufferGetHeight(imageBuffer);
size_t width = CVPixelBufferGetWidth(imageBuffer);
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer);
void *sourceData = CVPixelBufferGetBaseAddress(imageBuffer);
// Set a bunch of variables we need. The "radius" for the blur kernel needs to be positive and odd. The permute map maps the BGRA channels of the buffer to the ARGB that vImage needs.
@podkovyrin
podkovyrin / erase-git.sh
Last active Dec 10, 2015 — forked from k06a/erase-git.sh
Git remove some dirs
View erase-git.sh
# Fetch
git clone https://github.com/username/reponame reponame
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
# Analyze
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py && sudo python get-pip.py && rm get-pip.py
sudo pip install git-fat
git fat -a find 1000000
git ls-tree -r -t -l --full-name HEAD | sort -n -k 4
@podkovyrin
podkovyrin / fix_xcode_plugins.sh
Last active Sep 21, 2016
Update XCode plugins compatibility id
View fix_xcode_plugins.sh
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
@podkovyrin
podkovyrin / cupertino_update
Last active Aug 29, 2015
Download provisioning profile and install them
View cupertino_update
#!/usr/bin/env sh
# Install cupertino before run this script
# sudo gem install cupertino
# Validate input parameters
#
if [ ! $# == 5 ]; then
echo "Usage: $0 profile_name profile_output_path team_name username password"
exit 1
@podkovyrin
podkovyrin / gist:c8e68a6366070261caff
Created Sep 11, 2014
NSAttributedString from html string
View gist:c8e68a6366070261caff
[[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUTF8StringEncoding]
options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}
documentAttributes:nil error:nil];
You can’t perform that action at this time.