Skip to content

Instantly share code, notes, and snippets.

View atereshkov's full-sized avatar

Aliaksandr Tserashkou atereshkov

  • Vention
  • Warsaw, Poland
View GitHub Profile
@atereshkov
atereshkov / unused-swift-code.rb
Created January 21, 2024 18:54
Detect unused swift code
#!/usr/bin/ruby
#encoding: utf-8
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
class Item
def initialize(file, line, at)
@file = file
@line = line
@at = at + 1
@atereshkov
atereshkov / macos-ssh-keychain.txt
Created September 16, 2017 10:52
How to add a SSH Key to your MacOS Keychain
On Mac OSX, the native SSH client can use the built-in keychain directly.
Open terminal.
Write:
mkdir ~/.ssh
cd ~/.ssh
Copy your private key "id_rsa" to /.ssh folder.
Write in terminal also:
@atereshkov
atereshkov / podspec-example
Last active April 29, 2023 16:11
Xcode 10 Fat framework - How to create universal binary iOS framework (+ Cocoapods podspec)
If you've got something like this:
file was built for arm64 which is not the architecture being linked (x86_64):
Than this gist is for you.
Let's say you have already developed the framework itself and just want to build the binary
and distribute it through the Cocoapods.
1. Make sure your framework "Deployment Target" is equal to all the dependencies from your podspec file.
1. Brew
2. NVM
3. RVM
4. Change screenshots location
5. VPNs
6. Add .ssh
@atereshkov
atereshkov / swift-5-resumable-timer.swift
Created August 19, 2019 14:39
Swift 5 Resumable Timer
class ResumableTimer: NSObject {
private var timer: Timer? = Timer()
private var callback: () -> Void
private var startTime: TimeInterval?
private var elapsedTime: TimeInterval?
// MARK: Init
@atereshkov
atereshkov / gist:41fcc17667f502a12ea7581f8a930459
Last active February 15, 2023 12:36
Pull request template
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
**Ticket:** [12345]({BASE_LINK}/12345)
### Description
[//]: # (Give a brief summary of why the change is being implemented.)
### Changes
[//]: # (List change details here for Code Reviewers)
@atereshkov
atereshkov / gist:0573e710a38b8b91d2656d66e87e7915
Last active November 26, 2022 14:47
Installing Node.js and npm on MacOS
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
Run nvm installation script.
https://github.com/nvm-sh/nvm#install--update-script
If you get nvm: `command not found` after running the install script, troubleshoot it.
https://github.com/nvm-sh/nvm#troubleshooting-on-macos
This worked in my case on zsh:
You might need to restart your terminal instance or run `. ~/.nvm/nvm.sh`.
@atereshkov
atereshkov / xcode-duplicate-line.md
Last active September 5, 2022 07:49
Xcode 13 duplicate line shortcut (hotkey)

Xcode 13 duplicate line shortcut

  1. Run
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources//IDETextKeyBindingSet.plist
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
@atereshkov
atereshkov / itc_team_id.txt
Created April 16, 2019 14:19
How to get iTunes Connect (App Store Connect) Team ID and Team name? (fastlane)
Basically just type the following in a shell:
$ irb
irb> require "spaceship"
irb> Spaceship::Tunes.login("iTunesConnect_username", "iTunesConnect_password")
irb> Spaceship::Tunes.select_team
You'll be presented with a list of teams your account belongs to, along with the numerical representation for that team.
@atereshkov
atereshkov / change_screenshots_location_mac.md
Last active March 17, 2022 09:56
Change screenshots location on Mac

How to change where screenshots are saved on Mac

  1. Press Command-Shift-5 to open the Screenshot app.
  2. Select Options.
  3. From the Save to section, select your preferred location.
  4. If you select Other Location, you can choose a different folder of choice or create a new folder.

Command line:

defaults write com.apple.screencapture location /Users/alex/Screenshots