This file contains 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 | |
public func profiling<R>(label: String, @noescape _ block: () -> R) -> R { | |
NSLog("*** %@...", label) | |
let start = NSDate() | |
defer { | |
let end = NSDate() | |
NSLog("*** %@ took %5.3g seconds", label, end.timeIntervalSinceDate(start)) | |
} | |
return block() |
This file contains 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
// Examples are: "tell application \"Google Chrome\" to return URL of front document" | |
// Other web app specific versions here: https://gist.github.com/vitorgalvao/5392178 | |
let myAppleScript = "..." | |
var error: NSDictionary? | |
if let scriptObject = NSAppleScript(source: myAppleScript) { | |
if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error) { | |
if let result = output.stringValue { | |
print(output.stringValue) | |
} | |
} else if (error != nil) { |
This file contains 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
#!/bin/bash | |
# | |
# An example hook script to make use of push options. | |
# The example simply echoes all push options that start with 'echoback=' | |
# and rejects all pushes when the "reject" push option is used. | |
# | |
# To enable this hook, rename this file to "pre-receive". | |
# check if back merges are happening from important branches | |
echo "checking for bad branch names" |
This file contains 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
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
This file contains 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
{ | |
// Place your snippets for elixir here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
This file contains 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
// The purpose of this is that there was as cipher vulnerability found in the javascript implementation of the main | |
//. crypto-js library. | |
//. The native implementation they created made it unusable on react-native | |
// The reason we are using the node version of crypto is because the only supported AES from the react-native | |
//. implementation is aes-128-cbc | |
//. The node crypto library seems to be the only lib that supports that specific version. | |
// requires installing - https://www.npmjs.com/package/react-native-simple-crypto also linking | |
import RNSimpleCrypto from 'react-native-simple-crypto' | |
const toUtf8 = RNSimpleCrypto.utils.convertArrayBufferToUtf8 |
This file contains 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
name: Detox | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'customer/**' | |
- 'shared/**' |
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains 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 { Camera as RNCamera } from 'expo-camera' | |
const recordVideo = (cameraRef, options) => | |
cameraRef.recordAsync(options) | |
// VideoScreen is where the actual picture taking happens | |
const videoLimit = 11 | |
const Video = Machine({ | |
id: 'video', | |
initial: 'init', |
OlderNewer