Skip to content

Instantly share code, notes, and snippets.

View OdNairy's full-sized avatar

Roman Gardukevich OdNairy

View GitHub Profile
func generateSunColor(progress: Double) -> UIColor {
if progress < 0.2 {
return interpolateColor(from: .white,
to: UIColor(red: 255/255, green: 242/255, blue: 0/255, alpha: 1), // Yellow
with: (progress) / 0.2)
} else if progress < 0.4 {
return interpolateColor(from: UIColor(red: 255/255, green: 242/255, blue: 0/255, alpha: 1), // Yellow
to: .white,
with: (progress - 0.2) / 0.2)
} else if progress < 0.7 {
class Swiftlint < Formula
desc "Tool to enforce Swift style and conventions"
homepage "https://github.com/realm/SwiftLint"
url "https://github.com/realm/SwiftLint.git",
tag: "0.44.0",
revision: "e820e750b08bd67bc9d98f4817868e9bc3d5d865"
license "MIT"
head "https://github.com/realm/SwiftLint.git", branch: "master"
bottle do
@OdNairy
OdNairy / HD Video URLs
Created January 5, 2020 20:46 — forked from agassiyzh/HD Video URLs
#WWDC14 HD Videos & PDFs URLs
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/102xxw2o82y78a4/102/102_hd_platforms_state_of_the_union.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/103xx8s53gk94hl/103/103_hd_apple_design_awards.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/201xx2xfazhzce8/201/201_hd_advanced_topics_in_internationalization.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/202xx3ane09vxdz/202/202_hd_whats_new_in_cocoa_touch.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/203xxh9oqtm0piw/203/203_hd_introducing_healthkit.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/204xxhe1lli87dm/204/204_hd_whats_new_in_cocoa.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/205xxqzduadzo14/205/205_hd_creating_extensions_for_ios_and_os_x,_part_1.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/206xxdiurnffagr/206/206_hd_introducing_the_modern_webkit_api.mov?dl=1
@OdNairy
OdNairy / Priorbank.txt
Created June 21, 2019 09:49
Как переводить деньги на Приорбанк без комиссии
1. Откройте Интернет-Банкинг Приорбанк, выберите карту на которую хотите и нажмите кнопку "Подробнее".
2. Скопируйте номер договора для пополнения
3. Откройте ЕРИП для перевода с карты
4. Финансовые услуги - Банки, НКФО - Приорбанк - Пополнение
5. Вводите сумму
6. ...
7. Вы восхитительны. Profit!
@OdNairy
OdNairy / Swift Events.swift
Created April 18, 2019 09:20 — forked from ColinEberhardt/Swift Events
An eventing mechanism for Swift
/// An object that has some tear-down logic
public protocol Disposable {
func dispose()
}
/// An event provides a mechanism for raising notifications, together with some
/// associated data. Multiple function handlers can be added, with each being invoked,
/// with the event data, when the event is raised.
public class Event<T> {
@OdNairy
OdNairy / update_tf_data.rb
Last active June 2, 2019 19:43
Wait build to be processed and update changelog afterwards. fastlane 2.125+ required.
require 'spaceship'
module Fastlane
module Actions
module SharedValues
UPDATE_TF_CHANGELOG_CUSTOM_VALUE = :UPDATE_TF_CHANGELOG_CUSTOM_VALUE
end
class UpdateTfDataAction < Action
def self.run(params)
\e[36m/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
\e[36m/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
000000000001eca4 leaq 0x180882(%rip), %rdi ## literal pool for: "VECLIB_MAXIMUM_THREADS"
000000000001ecab callq 0x19f084 ## symbol stub for: _getenv
--
000000000001ef7c leaq 0x180abc(%rip), %rdi ## literal pool for: "APPLE_LAPACK_FILL_NAN"
000000000001ef83 callq 0x19f084 ## symbol stub for: _getenv
--
0000000000059865 leaq 0x1461d3(%rip), %rdi ## literal pool for: "APPLE_LAPACK_FILL_NAN"
000000000005986c callq 0x19f084 ## symbol stub for: _getenv
#!/usr/bin/env swift
import Foundation
protocol TestProtocol {
func foo(_ param: Int)
}
extension TestProtocol {
func foo() {
print("Default implementation")
curl -v -X PUT "https://rink.hockeyapp.net/api/2/apps/435279/meta" \
-H "X-HockeyAppToken: f098e04f87f342f8a6ffcf50d3e37716" \
-F "restore_allowed=disabled"
* Trying 54.225.129.170...
* Connected to rink.hockeyapp.net (54.225.129.170) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.hockeyapp.net
* Server certificate: Microsoft IT SSL SHA2
* Server certificate: Baltimore CyberTrust Root
> PUT /api/2/apps/435279/meta HTTP/1.1
Build target Panda of project Panda with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
cd /Users/odnairy/code/IntellectSoft/Panda
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Panda -Onone -D COCOAPODS -D COCOAPODS -D DEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -target arm64-apple-ios8.0 -g -module-cache-path /Users/odnairy/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -embed-bitcode-marker