Skip to content

Instantly share code, notes, and snippets.

View pruinis's full-sized avatar

Anton M. pruinis

  • Ukraine
View GitHub Profile
[
{
"skadnetwork_id": "m8dbw4sv7c.skadnetwork",
"entity_name": "DATASEAT LTD",
"creation_date": "2020-08-21T00:00:00Z"
},
{
"skadnetwork_id": "f7s53z58qe.skadnetwork",
"entity_name": "Tencent",
"creation_date": "2021-03-23T04:00:27.892Z"

Install Maven via Homebrew

Run following command on Terminal

    $ brew update
    $ brew install maven
@pruinis
pruinis / multiple_ssh_setting.md
Created March 19, 2019 23:18 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@pruinis
pruinis / gist:27f3371188c556416d9336283df601cb
Created November 3, 2016 01:35 — forked from bwhiteley/gist:049e4bede49e71a6d2e2
Initialize Swift subclass of UIView, designed in .xib
// Create CustomView.xib, set File's Owner to CustomView.
// Link the top level view in the XIB to the contentView outlet.
class CustomView : UIView {
@IBOutlet private var contentView:UIView?
// other outlets
override init(frame: CGRect) { // for using CustomView in code
super.init(frame: frame)
self.commonInit()
@pruinis
pruinis / ConcurrentOperation.swift
Created October 15, 2016 20:22 — forked from calebd/AsynchronousOperation.swift
Concurrent NSOperation in Swift
//
// ConcurrentOperation.swift
//
// Created by Caleb Davenport on 7/7/14.
//
// Learn more at http://blog.calebd.me/swift-concurrent-operations
//
import Foundation
@pruinis
pruinis / MKAnnotationView-v1.swift
Created August 17, 2016 12:55 — forked from mackuba/MKAnnotationView-v1.swift
Swift MKAnnotationView WTF
/*
MKAnnotationView has one init listed in its documentation, initWithAnnotation:reuseIdentifier:, so let's override that.
But this causes a runtime exception:
fatal error: use of unimplemented initializer 'init(frame:)' for class 'PulsatingDotMarker'
*/
class PulsatingDotMarker: MKAnnotationView {
let innerCircle: UIView
@pruinis
pruinis / NSString+Distance.h
Created August 15, 2016 14:17 — forked from KATT/NSString+Distance.h
NSString+Distance category (using ARC)
//
// NSString+Distance.h
//
// Created by Alexander Johansson on 2011-11-27.
// Based on http://stackoverflow.com/q/5684973/590396
//
#import <Foundation/Foundation.h>
@interface NSString (Distance)
@pruinis
pruinis / NSDate+Helper.swift
Created August 3, 2016 11:54
NSDate extension
//
// NSDate+Helper.swift
//
// Created by Anton Morozov on 27.07.16.
// Copyright © 2016 Anton Morozov. All rights reserved.
//
import Foundation
extension NSDate {
@pruinis
pruinis / PickerDetectTap.m
Last active August 1, 2016 16:22
UIPicker detect tap / touch on currently selected row
// Obj-C
// GestureRecognizer
UITapGestureRecognizer *tapToSelect = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tappedToSelectRow:)];
tapToSelect.delegate = self;
[self.pickerView addGestureRecognizer:tapToSelect];
#pragma mark - Actions
- (IBAction)tappedToSelectRow:(UITapGestureRecognizer *)tapRecognizer
{
@pruinis
pruinis / timeago.swift
Created May 1, 2016 14:43 — forked from minorbug/timeago.swift
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C)
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil)
if (components.year >= 2) {
return "\(components.year) years ago"