Skip to content

Instantly share code, notes, and snippets.

View Savchukv's full-sized avatar

Vasiliy Savchuk Savchukv

View GitHub Profile
@Savchukv
Savchukv / monstr.go
Last active February 6, 2016 18:24
Server
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"net/url"
//"flag"
"strconv"
"time"
@Savchukv
Savchukv / Reachability.swift
Last active May 31, 2017 14:13
Check internet connection
//
// Reachability.swift
//
// Created by Vasiliy Savchuk on 06.02.17.
// Copyright © 2017 All rights reserved.
//
// Usage this snippet:
// guard Reachability.sharedInstance.isReachable else {
// show alert
// return
@Savchukv
Savchukv / ExtensionView.swift
Created May 31, 2017 13:55
Example extension UIView for creating IOS screenshot
//
// ExtensionView.swift
//
// Created by Vasiliy Savchuk on 2/6/17.
// Copyright © 2017 All rights reserved.
//
// Usage this snippet:
// yourImageView.image = view.screenshot
import UIKit
@Savchukv
Savchukv / VideoViewController.swift
Created May 31, 2017 14:00
Play full screen video with routers
//
// ViewController.swift
//
// Created by Vasiliy Savchuk on 19.01.17.
// Copyright © 2017 All rights reserved.
//
import UIKit
import AVFoundation
import AVKit
@Savchukv
Savchukv / BackendService.swift
Created May 31, 2017 14:12
Example Alamofire request for login with constants string
//
// BackendService.swift
//
// Created by Vasiliy Savchuk on 27.01.17.
// Copyright © 2017 All rights reserved.
//
enum API {
static var token: String?
static var tokenType: String?
@Savchukv
Savchukv / UserViewController.swift
Created May 31, 2017 14:22
Example TableView Controller with extension UITableViewDataSource and UITableViewDelegate
//
// UserProfileViewController.swift
//
// Created by Vasiliy Savchuk on 01.02.17.
// Copyright © 2017 All rights reserved.
//
class UserProfileViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
@Savchukv
Savchukv / Alert.swift
Created May 31, 2017 14:35
Example to call Alert from different ViewControllers
//
// Alert.swift
//
// Created by Vasiliy Savchuk on 16.12.16.
// Copyright © All rights reserved.
//
// Usage this snippet:
// to call - displayAlert(title: "Oops!", message: "Error", viewController: self)
import Foundation
@Savchukv
Savchukv / PopUpViewController.swift
Created May 31, 2017 14:42
Example custom animation PopUp ViewController with sending email
//
// PopUpViewController.swift
//
// Created by Vasiliy Savchuk on 22.11.16.
// Copyright © 2016 All rights reserved.
//
// Usage this snippet:
// @IBAction func yourButtonDidPress(_ sender: Any) {
// let popOverVC = UIStoryboard(name: Constants.Storyboard.Map, bundle: nil).instantiateViewController(withIdentifier: Constants.StoryboardID.PopUpViewController) as! PopUpViewController
// popOverVC.pointModel = self.curentPoint
@Savchukv
Savchukv / LoginViewModel.swift
Created May 31, 2017 14:49
Example Login View Model with Firebase
//
// LoginViewModel.swift
//
// Created by Vasiliy Savchuk on 11/9/16.
// Copyright © 2016 All rights reserved.
//
// Usage this snippet:
// let viewModel: LoginViewModel = LoginViewModel()
//
// @IBAction func signInButtonDidPress(_ sender: Any) {
@Savchukv
Savchukv / GoogleMapViewController.swift
Created May 31, 2017 14:53
Example Google map ViewController
//
// GoogleMapViewController.swift
//
// Created by Vasiliy Savchuk on 11/21/16.
// Copyright © 2016 All rights reserved.
//
import UIKit
import GoogleMaps