Skip to content

Instantly share code, notes, and snippets.

View kos9kus's full-sized avatar
😶‍🌫️
Always coding

Kos kos9kus

😶‍🌫️
Always coding
View GitHub Profile
// public func save() {
// let appDirs = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
// guard let libraryDirectory = appDirs.first else {
// return
// }
// let files = (try? obtainDBFolderURL())?.path ?? ""
// let swiftArray = try? FileManager.default.contentsOfDirectory(atPath: files)
// swiftArray?.forEach({ path in
// if let urlComponents = URL(fileURLWithPath: path).pathComponents.last {
// let p = libraryDirectory + "/" + urlComponents
@kos9kus
kos9kus / gist:126150686b8cbc6ac338d54b851bb97a
Last active June 27, 2019 09:27
Shortcut for sublime text to indent JSON format
[
{
"keys": ["alt+shift+j"], "command": "set_syntax",
"args": {"syntax": "Packages/Javascript/JSON.tmLanguage"}
}
]
@kos9kus
kos9kus / LongestConsecutiveSequence.swift
Created January 19, 2019 19:57
Longest Consecutive Sequence
//
// LongestConsecutiveSequence.swift
// Test
//
// Created by KONSTANTIN KUSAINOV on 19/01/2019.
// Copyright © 2019 KONSTANTIN KUSAINOV. All rights reserved.
//
//Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
//
//
// PutZerosToTheEnd.swift
// Test
//
// Created by KONSTANTIN KUSAINOV on 16/12/2018.
// Copyright © 2018 KONSTANTIN KUSAINOV. All rights reserved.
//
import Foundation
UIVisualEffect *blurEffect;
blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *visualEffectView;
visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
// visualEffectView - UIImageView
visualEffectView.frame = self.imageView.bounds;
# Mac OS X
*.DS_Store
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
@kos9kus
kos9kus / iOS-POP-Framework_aggregate.sh
Last active July 4, 2017 10:44
Aggregate POP Framework for iOS
# Merge Script
# http://code.hootsuite.com/an-introduction-to-creating-and-distributing-embedded-frameworks-in-ios/
# 1
# Set bash script to exit immediately if any commands fail.
set -e
# 2
@kos9kus
kos9kus / gist:339cd5e8e80d05c571725240aaf43ddf
Created March 1, 2017 15:44
Git repository config convenience alias
[alias]
kksubmupdate = submodule update
kkcommitlastmsg = commit -a -c ORIG_HEAD
kkstatus = "!sh -c 'git fetch && git status' "
kkpull = "!sh -c 'git pull --rebase && git kksubmupdate' "
kkcommitall = commit -a
kkrebaseinteractive = rebase -i
kklogahead = "!sh -c 'var_branch_name=$(git name-rev --name-only HEAD) && git log origin/$var_branch_name..HEAD' "
kklogbehind = "!sh -c 'var_branch_name=$(git name-rev --name-only HEAD) && git log HEAD..origin/$var_branch_name' "
kkmovetodev = checkout "develop1"
@kos9kus
kos9kus / IDETextKeyBindingSet.plist
Created December 14, 2016 22:16
Xcode Keybindings with customized shortcut
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Cancellation</key>
<dict>
<key>Cancel</key>
<string>cancelOperation:</string>
</dict>
<key>Case Changes</key>
@kos9kus
kos9kus / NSURLErrorDomain.h
Last active October 25, 2024 05:04
URL Loading System Error Codes
These values are returned as the error code property of an NSError object with the domain “NSURLErrorDomain”.
Declaration
SWIFT
var NSURLErrorUnknown: Int { get }
var NSURLErrorCancelled: Int { get }
var NSURLErrorBadURL: Int { get }
var NSURLErrorTimedOut: Int { get }
var NSURLErrorUnsupportedURL: Int { get }
var NSURLErrorCannotFindHost: Int { get }