git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/* You may have to include your IOSurface header to compile, because of the GetLayerDefaultSurface function. If you do not have it, you may just uncomment the typedef to an IOSurface below. */ | |
#include <stdio.h> | |
#include <sys/mman.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
#define kIOMobileFramebufferError 0xE0000000 |
// | |
// Anchor.swift | |
// AnchorTest | |
// | |
// Created by Jonathan Wight on 7/10/15. | |
// Copyright © 2015 schwa.io. All rights reserved. | |
// | |
#if os(OSX) | |
import AppKit |
#define INC_SYSTEM_VERSION(v) ((NSOperatingSystemVersion){v.majorVersion, v.minorVersion + 1, 0}) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:v] | |
#define SYSTEM_VERSION_LESS_THAN(v) (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)) | |
#define SYSTEM_VERSION_EQUAL_TO(v) (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) && (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(INC_SYSTEM_VERSION(v)))) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) (SYSTEM_VERSION_LESS_THAN(v) || SYSTEM_VERSION_EQUAL_TO(v)) | |
#define SYSTEM_VERSION_GREATER_THAN(v) (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) && (!SYSTEM_VERSION_EQUAL_TO(v))) | |
/* | |
// Manual logical check | |
NSOperatingSystemVersion v = (NSOperatingSystemVersion){8, 4, 0}; |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
Homebrew build logs for infer on macOS 10.12 | |
Build date: 2016-11-07 17:21:10 |
typealias UIAlertActionHandler = ((UIAlertAction) -> Swift.Void)? | |
private struct AssociatedKeys { | |
static var handler = "cc_handler" | |
} | |
private let swizzling: (UIAlertAction.Type) -> () = { action in | |
// in swift this looks like an init, but in obj-c it's really actionWithTitle:style:handler class method | |
let originalSelector = #selector(UIAlertAction.init(title:style:handler:)) | |
let swizzledSelector = #selector(UIAlertAction.action(testTitle:style:handler:)) // so swizzling an init won't work. we have to use another class method | |
const firebase = require('firebase-admin'); | |
var serviceAccountSource = require("./source.json"); // source DB key | |
var serviceAccountDestination = require("./destination.json"); // destination DB key | |
const sourceAdmin = firebase.initializeApp({ | |
credential: firebase.credential.cert(serviceAccountSource) | |
}); | |
const destinationAdmin = firebase.initializeApp({ |
import { sync } from 'glob'; | |
import { camelCase, last } from 'lodash'; | |
const files = sync('./**/*.function.[tj]s', { cwd: __dirname, ignore: './node_modules/**' }); | |
for (let f = 0, fl = files.length; f < fl; f += 1) { | |
const file = files[f]; | |
const functionName = camelCase(last(file.slice(0, -12).split('/'))); // Strip off '.function.js' | |
if (!process.env.FUNCTION_NAME || process.env.FUNCTION_NAME === functionName) { | |
// eslint-disable-next-line import/no-dynamic-require, global-require | |
exports[functionName] = require(file); |