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 { commandFactory: CommandFactory } = require('hystrixjs'); | |
/** | |
* Initializes and returns a circuit breaker | |
* @param {function} fn Function to execute | |
* @param {object} opts Hystrix options | |
* @property {number} opts.timeout Timeout for request | |
* @property {function} opts.errorHandler Function to validate if the error response from the service is an actual error | |
* @property {function} opts.fallbackTo Function, which will be executed if the request fails. The function will be called with the error as the 1st argument and an array of the original args as the 2nd argument | |
* @property {number} opts.circuitBreakerSleepWindowInMilliseconds How long the circuit breaker should stay opened, before allowing a single request to test the health of the service |
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/sh | |
sudo killall -HUP mDNSResponder | |
sudo killall mDNSResponderHelper | |
sudo dscacheutil -flushcache |
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/sh | |
# Compare content of two folders recursively, without MacOS X specific files and ignore attributes/user/group | |
rsync --dry-run --no-perms --no-owner --no-group --no-times --exclude=.DS_Store --exclude=._* -v -r -c <source> <destination> |
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
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
# | |
# Update 2013-06-24: added -w0 option to prevent truncated lines | |
require 'base64' | |
data=`ioreg -l -w0 -d0 -r -c AppleDisplay` |