Skip to content

Instantly share code, notes, and snippets.

View mariancerny's full-sized avatar

Marián Černý mariancerny

View GitHub Profile
@mariancerny
mariancerny / TransparentViewController.m
Created May 16, 2014 07:15
Wrapper for a modal view controller that should be assigned to rootViewController of a new UIWindow, so that the modal view controller can be presented out of the application flow (based for example on an external event).
@protocol TransparentViewControllerDelegate;
@interface TransparentViewController : UIViewController
- (instancetype)initWithRootViewController:(UIViewController *)rootViewController;
@property (nonatomic, weak) id<TransparentViewControllerDelegate> delegate;
@end
@mariancerny
mariancerny / gist:eb570f711ac01246c26a
Created May 25, 2014 20:41
Coding Dojo #11 (2014-05-22)
//
// BowlingKataTests.m
// BowlingKataTests
//
// Created by Marián Černý on 22.05.14.
//
//
#import <XCTest/XCTest.h>
@mariancerny
mariancerny / crontab
Last active March 18, 2023 16:15
Scripts to perform ZFS hourly, daily and monthly backups using ZFS snapshot feature.
# ZFS Backups
3 0 * * * root sh /opt/sbin/zfs-backup.sh
2 1-23 * * * root sh /opt/sbin/zfs-backup-hourly.sh
33 10 9 * * root sh /opt/sbin/zfs-backup-monthly.sh
// Kontrola rodného čísla.
// @author: Marián Černý
private function is_RC_valid($value) {
if (!preg_match('@^([0-9][0-9])([0-9][0-9])([0-9][0-9])/?([0-9]{3})([0-9])?$@', $value, $regs))
return false;
list($expression, $year, $month, $day, $ext) = $regs;
$c = isset($regs[5]) ? $regs[5] : "";
if (strlen($value) == 9) {