Skip to content

Instantly share code, notes, and snippets.

View Stmol's full-sized avatar
👨‍🔧
SwiftUI & Flutter

Yury S. Stmol

👨‍🔧
SwiftUI & Flutter
  • Earth
View GitHub Profile
@Stmol
Stmol / SynchronizedArray.swift
Created October 1, 2018 19:48
Swift 4 - Thread Safe Array
import Foundation
/// A thread-safe array.
public class SynchronizedArray<Element> {
fileprivate let queue = DispatchQueue(label: "io.data.SynchronizedArray", attributes: .concurrent)
fileprivate var array = [Element]()
}
// MARK: - Properties
public extension SynchronizedArray {
@Stmol
Stmol / Cache.swift
Created March 17, 2018 13:58 — forked from mohamede1945/Cache.swift
NSCache wrapper that works with Swift structs
private class ObjectWrapper {
let value: Any
init(_ value: Any) {
self.value = value
}
}
private class KeyWrapper<KeyType: Hashable>: NSObject {
let key: KeyType
@Stmol
Stmol / plugin.sh
Last active October 3, 2018 16:17
[Oh my zsh Plugin for Docker] #config
alias dco='docker-compose'
alias dcb='docker-compose build'
alias dce='docker-compose exec'
alias dcps='docker-compose ps'
alias dcrestart='docker-compose restart'
alias dcrm='docker-compose rm'
alias dcr='docker-compose run'
alias dcstop='docker-compose stop'
alias dcup='docker-compose up'
@Stmol
Stmol / to-learn.txt
Last active October 3, 2018 16:14
[Resources List To Learn] #notes
Общее:
- Криптовалюта (курсера): https://www.coursera.org/learn/cryptocurrency
- ML: https://tproger.ru/digest/machine-learning-materials/amp
- ML: https://habrahabr.ru/company/ods/blog/322626/
- ML (курс): https://www.udacity.com/course/machine-learning-engineer-nanodegree--nd009
- Микросервисы от Авито: https://habrahabr.ru/company/avito/blog/331418
- Kotlin (android app): https://android.jlelse.eu/learn-kotlin-while-developing-an-android-app-part-2-e53317ffcbe9
- КУРСЫ: https://habrahabr.ru/post/331530
- Регулярки: http://telegra.ph/Regulyarnye-vyrazheniya-dlya-samyh-malenkih-12-12
- Оценка сложности алгоритмов: https://tproger.ru/articles/computational-complexity-explained/
@Stmol
Stmol / clear-origin.sh
Created February 21, 2016 13:02
Delete remote git merged branches
for branch in `git branch -r --merged | grep -v HEAD | grep -v dev | grep -v master`
do
echo $branch
echo $branch | sed 's/origin\//:/' | xargs -n 1 git push origin
sleep 3
done
@Stmol
Stmol / preferences.sublime-settings
Last active October 3, 2018 16:04
Preferences for Sublime Text 3 #settings
{
"auto_complete_delay": 0,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_white_space": "all",
"fade_fold_buttons": false,
"fallback_encoding": "Cyrillic (Windows 1251)",
"folder_exclude_patterns":
[
<?php
class File
{
private $file;
private $buffer;
public function __construct($filename, $mode)
{
@Stmol
Stmol / brew.plugin.zsh
Last active August 29, 2015 14:01
My zsh options
#compdef brew
#autoload
# imported from the latest homebrew contributions
_brew_all_formulae() {
formulae=(`brew search`)
}
_brew_installed_formulae() {
@Stmol
Stmol / bash_profile
Last active October 3, 2018 16:14
[My bash profile on Mac OS X] #settings
# export PATH="/usr/local/mysql/bin:$PATH"
export EDITOR='subl -w'
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export HOMEBREW_GITHUB_API_TOKEN=''
PS1='➞ \w$ '
@Stmol
Stmol / hack.sh
Created May 17, 2014 19:29 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#