Skip to content

Instantly share code, notes, and snippets.

View romanfurman6's full-sized avatar
🎯
Focusing

Roman Furman romanfurman6

🎯
Focusing
View GitHub Profile
# Functions for recording a video or taking a screenshot from the currently booted simulator and saving it in the Screenshots folder.
# Installation: put it in your .zshrc or .bashrc
# Usage: "$ simrec" or "$ simscr" in terminal
function simrec() {
currentDate=$(date "+%Y-%m-%d at %H.%M.%S")
screenshotsPath="$HOME/Screenshots"
fileName="Screen Recording ${currentDate}.mp4"
fullPath="${screenshotsPath}/${fileName}"
echo "Recording Video in ${fullPath}"
func request() {
let url = URL(string: "http://424de02b.ngrok.io/web_sarvar")!
let task = URLSession.shared.dataTask(with: url) { [weak self] (data, _, _) in
guard
let data = data,
let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
let text = json["versas"] as? String
else { return }
DispatchQueue.main.async { self?.updateLabel(with: text) }
}
import UIKit
import os.signpost
class ViewController: UIViewController {
let label = UILabel()
let viewDidLoadOSLog = OSLog(subsystem: "com.uptech.TestProject", category: .pointsOfInterest)
override func viewDidLoad() {
super.viewDidLoad()
@romanfurman6
romanfurman6 / UIDevice+Type.swift
Last active September 19, 2019 12:47
UIDevice+Type
import UIKit
extension UIDevice {
// swiftlint:disable identifier_name
enum DeviceType {
case iPhone5s_Se
case iPhone6_7_8
case iPhone6_7_8Plus
case iPhoneX_Xs
class SadCollectionViewFlowLayout: UICollectionViewFlowLayout {
private let sideItemScale: CGFloat = 0.9
private let sideItemAlpha: CGFloat = 0.9
private let sideItemShift: CGFloat = 0.0
override open func prepare() {
super.prepare()
guard let collectionSize = collectionView?.bounds.size else { return }
let yInset = (collectionSize.height - itemSize.height) / 2
excluded:
- Carthage/
identifier_name:
excluded:
- id
- x
- y
- i
- vc
class RxImagePickerDelegateProxy:
DelegateProxy<UIImagePickerController, UIImagePickerControllerDelegate & UINavigationControllerDelegate>,
DelegateProxyType,
UIImagePickerControllerDelegate,
UINavigationControllerDelegate {
weak private(set) var imagePicker: UIImagePickerController?
internal init(imagePicker: UIImagePickerController) {
self.imagePicker = imagePicker
class CollectionViewFlowLayout: UICollectionViewFlowLayout {
private let sideItemScale: CGFloat = 0.9
private let sideItemAlpha: CGFloat = 0.9
private let sideItemShift: CGFloat = 0.0
var visibleOffset: CGFloat!
override open func prepare() {
super.prepare()
self.updateLayout()
Process: simutrans [46493]
Path: /Users/USER/Library/Application Support/Steam/*/simutrans.app/Contents/MacOS/simutrans
Identifier: org.simutrans.simutrans
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: ??? [46489]
Responsible: simutrans [46493]
User ID: 501
Date/Time: 2018-03-03 16:41:01.376 +0200