- Download docker-compose.yml to dir named
sentry
- Change
SENTRY_SECRET_KEY
to random 32 char string - Run
docker-compose up -d
- Run
docker-compose exec sentry sentry upgrade
to setup database and create admin user - (Optional) Run
docker-compose exec sentry pip install sentry-slack
if you want slack plugin, it can be done later - Run
docker-compose restart sentry
- Sentry is now running on public port
9000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Swift* | |
// Старая документация от Apple — это золото. Но и актуальной не брезгуй. | |
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html#//apple_ref/doc/uid/10000011i | |
https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226 | |
// Это вообще Threading Programming Guide, но тут есть о Runloop :) | |
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1 | |
// Блог Mike Ash-a набирает в полезности со временем | |
https://www.mikeash.com/pyblog/friday-qa-2017-09-22-swift-4-weak-references.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreGraphics | |
import Accelerate | |
import CoreImage | |
import UIKit | |
extension CGImage { | |
public enum Error: Swift.Error { | |
case imageResizingFailed | |
case cgContextCreationFailed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIImage { | |
func toCVPixelBuffer() -> CVPixelBuffer? { | |
let attrs = [kCVPixelBufferCGImageCompatibilityKey: kCFBooleanTrue, kCVPixelBufferCGBitmapContextCompatibilityKey: kCFBooleanTrue] as CFDictionary | |
var pixelBuffer : CVPixelBuffer? | |
let status = CVPixelBufferCreate(kCFAllocatorDefault, Int(self.size.width), Int(self.size.height), kCVPixelFormatType_32ARGB, attrs, &pixelBuffer) | |
guard status == kCVReturnSuccess else { | |
return nil | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if is_paginated %} | |
<nav aria-label="Page navigation example"> | |
<ul class="pagination justify-content-left"> | |
{% if page_obj.has_previous %} | |
<li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">«</a></li> | |
{% else %} | |
<li class="page-item disabled"><a class="page-link" href="#"><span>«</span></a></li> | |
{% endif %} | |
{% for i in paginator.page_range %} | |
{% if page_obj.number == i %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pluralizeRussian(number, nom_sing, gen_sing, gen_pl): | |
s_last_digit = str(number)[-1] | |
if int(str(number)[-2:]) in range(11,20): | |
#11-19 | |
return gen_pl | |
elif s_last_digit == '1': | |
#1 | |
return nom_sing | |
elif int(s_last_digit) in range(2,5): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol StringEnum { | |
var rawValue: String { get } | |
} | |
extension Dictionary { | |
subscript(enumKey: StringEnum) -> Value? { | |
get { | |
if let key = enumKey.rawValue as? Key { | |
return self[key] | |
} |