Skip to content

Instantly share code, notes, and snippets.

View tularovbeslan's full-sized avatar
:octocat:
Working from home

Beslan Tularov tularovbeslan

:octocat:
Working from home
View GitHub Profile
{
"data":{
"Big":[
{
"date":"21.06.2019",
"name":"46 серия",
"url":"https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4",
"thumb":"https://peach.blender.org/wp-content/uploads/big_big_buck_bunny_small.jpg?x43337"
}
],
@tularovbeslan
tularovbeslan / HandlingIndexOutofRangeException.txt
Last active May 29, 2019 00:26
Handling Index Out of Range Exception the Swift Way
extension Collection {
subscript(safe index: Index) -> Element? {
return indices.contains(index) ? self[index] : nil
}
}
@tularovbeslan
tularovbeslan / SCNText+Typewriter.swift
Created May 25, 2019 18:54
An Example Of Animating SCNText With A Typewriter Like Effect
//1. Timer To Animate Our Text
var animationTimer: Timer?
//2. Variable To Store The Current Time
var time:Int = 0
/// Animates The Presentation Of SCNText To Give An Appearance Of A Typing Effect
///
/// - Parameters:
/// - textGeometry: SCNText
{
"data":[
{
"url":"https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_30mb.mp4",
"name":"Bug bunny",
"type":"MP4"
},
{
"url":"https://sample-videos.com/audio/mp3/wave.mp3",
"name":"Noise",
This file has been truncated, but you can view the full file.
[
{
"ISIN": "SP72EL7RYK6UN1G",
"STAT": {
"W": {
"price": [
{
"date": 1547413200000,
"price": 10.35
localeIdentifier Description
eu Basque
hr_BA Croatian (Bosnia & Herzegovina)
en_CM English (Cameroon)
rw_RW Kinyarwanda (Rwanda)
en_SZ English (Swaziland)
tk_Latn Turkmen (Latin)
he_IL Hebrew (Israel)
ar Arabic
uz_Arab Uzbek (Arabic)
@tularovbeslan
tularovbeslan / NSDataExtensions.swift
Created July 9, 2018 16:47 — forked from huguesbr/NSDataExtensions.swift
Convert to and from NSData for common Swift types. Includes Eddystone URL conversion.
//
// NSDataExtensions.swift
// MAPO
//
// Created by Hugues Bernet-Rollande on 21/3/16.
// Copyright © 2016 WB Technologies. All rights reserved.
//
import Foundation
@tularovbeslan
tularovbeslan / Hide statusbar.txt
Last active January 24, 2018 11:19
Hide statusbar with slide animation
class ViewController: UIViewController {
var isHidden:Bool = false {
didSet{
UIView.animate(withDuration: 0.5) { () -> Void in
self.setNeedsStatusBarAppearanceUpdate()
}
}
}
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation{
@tularovbeslan
tularovbeslan / UIPageControl dot border
Created August 4, 2017 11:02
UIPageControl dot border
extension UIImage {
class func outlinedEllipse(size: CGSize, color: UIColor, lineWidth: CGFloat = 1.0) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
guard let context = UIGraphicsGetCurrentContext() else {
return nil
}
context.setStrokeColor(color.cgColor)
context.setLineWidth(lineWidth)
@tularovbeslan
tularovbeslan / Email and password validate
Created July 9, 2017 19:54
Email and password validate
func isValidEmail(email: String) -> Bool {
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
let validatedEmail = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
return validatedEmail.evaluate(with: email)
}
func isValidPassword(password: String) -> Bool {
let passwordRegEx = "[A-Z0-9a-z]{5,}"
let validatedPassword = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
return validatedPassword.evaluate(with: password)