Skip to content

Instantly share code, notes, and snippets.

View oleghnidets's full-sized avatar
📱

Oleg oleghnidets

📱
View GitHub Profile
for git_tag in $(git tag -l | grep Testing/v2.0.0); do git tag --delete $git_tag; git push --delete origin $git_tag; done
@oleghnidets
oleghnidets / git_remove_not_existing_tags.sh
Created May 27, 2020 13:04
Prune local git tags that don't exist on remote
# https://demisx.github.io/git/2014/11/02/git-prune-local-tags-dont-exist-remote.html
git tag -l | xargs git tag -d && git fetch -t
@oleghnidets
oleghnidets / git_old_tags.sh
Last active May 27, 2020 11:01
Delete outdated tags/branches
for git_tag in $(git tag -l | grep Testing); do git tag --delete $git_tag; done
@oleghnidets
oleghnidets / test_simulator.apns
Created May 22, 2020 13:14
Simulator push notification template
{
"Simulator Target Bundle": "com.app.bundleid",
"aps": {
"alert": {
"title": "Push on the simulator \ue057",
"subtitle": "So cool notification",
"body": "This notification is going to show up in the simulator!"
}
}
}
@oleghnidets
oleghnidets / UIImage+Tint.swift
Created February 6, 2020 14:45
Tint image before iOS 13
func tinted(withColor color: UIColor) -> UIImage {
guard let maskImage = cgImage else {
return self
}
let bounds = CGRect(origin: .zero, size: size)
let renderer = UIGraphicsImageRenderer(size: size)
return renderer.image { context in
let cgContext = context.cgContext
@oleghnidets
oleghnidets / git-log
Last active November 18, 2019 12:58
Git log today commits by author
git log --since="00:00" --author="Oleg Gnidets" --all
@oleghnidets
oleghnidets / Data+JSON.swift
Created November 5, 2019 08:16
Prin pretty JSON from Data
extension Data {
// NSString gives a nice sanitized debugDescription
var prettyPrintedJSONString: NSString? {
guard let object = try? JSONSerialization.jsonObject(with: self, options: []) else {
print("Cannot serialize JSON object.")
return nil
}
guard let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]) else {
@oleghnidets
oleghnidets / ConcatenationTest.swift
Last active June 5, 2018 07:19
Test concatenation
// Created by Oleg H. on 5/17/18.
// Copyright © 2018 Oleg H. All rights reserved.
//
import XCTest
let count = 150000
/*
Plust operator is faster.