Skip to content

Instantly share code, notes, and snippets.

vahotm

Block or report user

Report or block vahotm

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
@vahotm
vahotm / CenterInContainerWithVFL.m
Last active Jan 20, 2016
Snippet for constraints in Visual Format Language, that center view vertically and horizontally in its superview.
View CenterInContainerWithVFL.m
// Vertical center in container
[superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[superview]-(<=1)-[view]"
options:NSLayoutFormatAlignAllCenterY
metrics:nil
views:viewDict]];
// Horizontal center in container
[superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[superview]-(<=1)-[view]"
options:NSLayoutFormatAlignAllCenterX
metrics:nil
@vahotm
vahotm / Regex for cyrillic chars.txt
Created Jan 20, 2016
Following regex matches cyrillic characters in localization keys for NSLocalizedString
View Regex for cyrillic chars.txt
// Following regex matches cyrillic characters in localization keys for NSLocalizedString
//---------------------------------------------------------------------------------------
NSLocalizedString\(@"([\w\s\d]*?)([а-яА-Я]+)([\w\s\d]*?)"
//----------------------------------
// Test cases
//----------------------------------
NSLocalizedString(@"Notification", nil)
NSLocalizedString(@"Notificatio n ъ s df
", nil)
View LTHPasscodeViewController.podspec.json
{
"name": "LTHPasscodeViewController",
"version": "3.8.5",
"license": {
"type": "MIT",
"file": "LICENSE.txt"
},
"authors": {
"Roland Leth": "roland@leth.ro"
},
@vahotm
vahotm / script.sh
Last active Dec 12, 2018
Write git diff into file on Desktop
View script.sh
git rev-parse --git-dir 1>/dev/null && git add -N . && git diff > "${HOME}/Desktop/$(basename $(git rev-parse --show-toplevel))_$(date '+%d-%m-%Y_%H-%M-%S').diff"
You can’t perform that action at this time.