Skip to content

Instantly share code, notes, and snippets.

View vdugnist's full-sized avatar

Vlad Dugnist vdugnist

View GitHub Profile
@vdugnist
vdugnist / UIButton+spinner.swift
Created October 11, 2023 16:28
UIButton extension that allows replacing button with a loading indicator and back with one line of code
import UIKit
extension UIButton {
func hideButtonAndShowSpinner() {
self.isHidden = true
let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
if self.superview?.subviews.first(where: { (view) -> Bool in
return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
}) != nil {
@vdugnist
vdugnist / Spacedust.xccolortheme
Last active March 11, 2020 14:36
Spacedust.xccolortheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.052 0.489 0.482 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.432 0.325 0.276 1</string>

Privacy Policy

Vladislav Dugnist built the Rollerschool app as a Free app. This SERVICE is provided by Vladislav Dugnist at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Rollerschool unless otherwise defined in this Privacy Policy.

#!/bin/bash
function exclude_odd_folders_and_format {
egrep -v "^Pods|^tools" | tr '\n' '\0' | xargs -0 clang-format -i -style=file
}
export -f exclude_odd_folders_and_format
if [ $# -eq 0 ]; then
find . -type f -name *.h -o -name *.m -o -name *.mm | sed "s/^\.\///g" | exclude_odd_folders_and_format
exit 0
@vdugnist
vdugnist / compress_video_folder.sh
Created April 1, 2018 08:02
Compress video folder
#!/bin/bash
if [[ ! $1 ]]; then
echo "directory path is required"
exit 1
fi
dir_path=$1
# remove last '/' if needed
echo "gem: --user-install -n~/bin --no-document" > ~/.gemrc
echo "PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" > ~/.bash_profile
. ~/.bash_profile
@vdugnist
vdugnist / check-categories-compiled.rb
Last active April 13, 2018 22:36
Check that imported category exists in targets compile source.
require 'xcodeproj'
require 'set'
SOURCE_FOLDER=ARGV[0] ? ARGV[0] : ENV['PROJECT_DIR']
PROJECT_PATH=ARGV[1] ? ARGV[1] : ENV['PROJECT_FILE_PATH']
if !SOURCE_FOLDER || !PROJECT_PATH then
puts "usage: ruby check-categories_compiled.rb source_folder project_path"
exit 1
end
@vdugnist
vdugnist / uiimage_check.sh
Last active February 11, 2021 06:42
Check if UIImage exists in assets
#!/bin/bash
CLASSES_FOLDERS=($PROJECT_NAME)
RESOURCE_FOLDER=$PROJECT_NAME
function show_code {
for ClassFolder in "${CLASSES_FOLDERS[@]}"; do
# try to find image name in [UIImage imageNamed:] pattern
ERROR_LOCATION=$(grep -Ron "\[UIImage imageNamed:@\"$1\"]" $ClassFolder)
if [[ -n $ERROR_LOCATION ]]; then break; fi;
@vdugnist
vdugnist / setup.sh
Last active November 28, 2021 14:15
#!/bin/bash
# check if user logged in into appstore
read -p "Check if you are logged in into AppStore. Press enter to continue ↵"
# install oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"