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
| @echo off | |
| rem batch file which starts video recording | |
| for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x | |
| rem echo %MyDate% | |
| set today=%MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2% | |
| set time=%MyDate:~8,2%-%MyDate:~10,2% | |
| set filename=%today%_%time%.mp4 | |
| echo %today% |
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
| // MIT License | |
| // | |
| // Copyright (c) 2016 stable|kernel | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
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
| class UIShowHideTextField: UnderlinedTextField { | |
| let rightButton = UIButton(type: .custom) | |
| required init?(coder aDecoder: NSCoder) { | |
| super.init(coder: aDecoder) | |
| commonInit() | |
| } | |
| required override init(frame: CGRect) { |
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
| class UIShowHideTextField: UnderlinedTextField { | |
| let rightButton = UIButton(type: .custom) | |
| required init?(coder aDecoder: NSCoder) { | |
| super.init(coder: aDecoder) | |
| commonInit() | |
| } | |
| required override init(frame: CGRect) { |
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
| //more info on https://stackoverflow.com/questions/24215117/how-to-recognize-swipe-in-all-4-directions | |
| class BaseViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(swiped)) | |
| swipeRight.direction = UISwipeGestureRecognizerDirection.right | |
| self.view.addGestureRecognizer(swipeRight) | |
| let swipeLeft = UISwipeGestureRecognizer(target: self, action: #selector(swiped)) | |
| swipeLeft.direction = UISwipeGestureRecognizerDirection.left |
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
| // | |
| // UIDevice+Extensions.swift | |
| // tenbet | |
| // | |
| // Created by Emil Atanasov on 28.10.19. | |
| // Copyright © 2019. All rights reserved. | |
| // | |
| //based on https://stackoverflow.com/questions/46192280/detect-if-the-device-is-iphone-x/47067296 |
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
| // Created by © 2020 SwiftEverywhere. Can be used free of charge. | |
| import UIKit | |
| //protocol | |
| protocol BadgeContainer: class { | |
| var timer: Timer? { get set } | |
| var badgeView: UIView? { get set } | |
| var label: UILabel? { get set } | |
| func showBadge(blink: Bool, text: String?) | |
| func hideBadge() | |
| } |
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
| // Created by © 2020 SwiftEverywhere. Can be used free of charge. | |
| import UIKit | |
| //protocol | |
| protocol BadgeContainer: class { | |
| var badgeView: UIView? { get set } | |
| var badgeLabel: UILabel? { get set } | |
| func showBadge(blink: Bool, text: String?) | |
| func hideBadge() | |
| } | |
| //default protocol implementation |
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
| //custom class | |
| //Don't forget to assigne that custom class to your UIButton views in the storyboard file | |
| class BadgeButton: UIButton, BadgeContainer { | |
| var badgeTimer: Timer? | |
| var badgeView: UIView? | |
| var badgeLabel: UILabel? | |
| } | |
| //here is how to use it in simple view controller | |
| class MyViewController: UIViewController { |
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
| REM add watermark to all JPG images in the same folder | |
| REM resize all JPG images in the same folder | |
| REM put the result in different folder | |
| SET IMAGE_MAGICK="C:\Program Files\ImageMagick-7.0.10-Q16\magick.exe" | |
| SET SIZE=700x700 | |
| mkdir watermark | |
| mkdir resize | |
| for /F "usebackq delims=" %%i in (`dir /a:-d /b %foldername%\*.jpg`) do %IMAGE_MAGICK% %%i ( watermark.png ) -gravity center -composite watermark\%%i |