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
public final class SpendModel: RealmModel { | |
// MARK: - Properties | |
@objc public dynamic var string = "" | |
// MARK: - Init | |
public convenience init(with string: String) { | |
self.init() | |
self.string = string |
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
open class RealmModel: Object { | |
// MARK: - Properties | |
@objc dynamic var id: Int = nextID() | |
// MARK: - Internal | |
private static func nextID() -> Int { | |
return RealmService.shared.nextID(for: self) | |
} |
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
public final class RealmService { | |
public var realm: Realm { | |
return try! Realm() | |
} | |
// MARK: - Interface | |
public func nextID<Model: Object>(for modelType: Model.Type) -> Int { | |
let className = String(describing: modelType) | |
// |
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
// | |
// GooglePromiseTests.swift | |
// PromiseTests | |
// | |
// Created by Evgeniy on 06.02.18. | |
// | |
import Promise | |
import XCTest |
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
/* | |
********************************************************************* | |
Part of UEFI DXE driver code that injects Hyper-V VM exit handler | |
backdoor into the Device Guard enabled Windows 10 Enterprise. | |
Execution starts from new_ExitBootServices() -- a hook handler | |
for EFI_BOOT_SERVICES.ExitBootServices() which being called by | |
winload!OslFwpKernelSetupPhase1(). After DXE phase exit winload.efi | |
transfers exeution to previously loaded Hyper-V kernel (hvix64.sys) |
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 datetime, requests | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import json, collections, os | |
UTC_OFFSET = -14400 # Local offset from UTC | |
START_DATE = "2016-01-01" # Day to start chat | |
TMP_DIR = "/tmp" # Writable temp directory, without trailing slash |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
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 <Foundation/Foundation.h> | |
typedef uint64_t CGSSpace; | |
typedef uint64_t CGSManagedDisplay; | |
typedef int CGSConnection; | |
typedef enum _CGSSpaceSelector { | |
kCGSSpaceCurrent = 5, | |
kCGSSpaceOther = 6, | |
kCGSSpaceAll = 7 |
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
static void dispatch_repeated_internal(dispatch_time_t firstPopTime, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop)) | |
{ | |
__block BOOL shouldStop = NO; | |
dispatch_time_t nextPopTime = dispatch_time(firstPopTime, (int64_t)(intervalInSeconds * NSEC_PER_SEC)); | |
dispatch_after(nextPopTime, queue, ^{ | |
work(&shouldStop); | |
if(!shouldStop) | |
{ | |
dispatch_repeated_internal(nextPopTime, intervalInSeconds, queue, work); | |
} |
NewerOlder