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
{ | |
"description": "Rules based on Skype FAQ at https://support.skype.com/en/faq/FA148/which-ports-need-to-be-open-to-use-skype-on-desktop", | |
"name": "Skype", | |
"rules": [ | |
{ | |
"action": "allow", | |
"process": "/Applications/Skype.app/Contents/MacOS/Skype", | |
"ports": "443,1000-10000,50000-65000,16000-26000", | |
"protocol": "TCP" | |
}, |
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
{ | |
"description": "Rules based on Microsoft Endpoints at https://endpoints.office.com/endpoints/worldwide?clientrequestid=b794baa0-662f-4592-b4f0-46ab3284b612&ServiceAreas=Skype", | |
"name": "Microsoft Teams", | |
"rules": [ | |
{ | |
"action": "allow", | |
"process": "/Applications/Microsoft Teams (work or school).app/Contents/MacOS/MSTeams", | |
"remote-addresses": "13.107.64.0-13.107.127.255,52.112.0.0-52.115.255.255,52.122.0.0-52.123.255.255,2603:1063::-2603:1063:3ff:ffff:ffff:ffff:ffff:ffff", | |
"ports": "3478-3481", | |
"protocol": "udp" |
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
{ | |
"description": "Rules based on Microsoft Endpoints at https://endpoints.office.com/endpoints/worldwide?clientrequestid=b794baa0-662f-4592-b4f0-46ab3284b612&ServiceAreas=Skype", | |
"name": "Microsoft Teams classic", | |
"rules": [ | |
{ | |
"action": "allow", | |
"process": "/Applications/Microsoft Teams classic.app/Contents/MacOS/Teams", | |
"remote-addresses": "13.107.64.0-13.107.127.255,52.112.0.0-52.115.255.255,52.122.0.0-52.123.255.255,2603:1063::-2603:1063:3ff:ffff:ffff:ffff:ffff:ffff", | |
"ports": "3478-3481", | |
"protocol": "udp" |
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/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
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/env ruby | |
# | |
# This script is an astonishing feat of top notch | |
# rockstar craftsmanship. It totally uses artificial | |
# intelligence to extract colors out of tmTheme and | |
# build an itermcolors scheme file for iTerm2. | |
# | |
# I know this sounds crazy, but it actually knows | |
# approximately what colors should be used in the | |
# ANSI list, and tries to find nearest colors from |
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
require 'minitest/mock' | |
module StubStrict | |
module_function | |
def render_parameters(ruby_parameters) | |
ruby_parameters.map { |type, name| | |
case type | |
when :req; name.to_s | |
when :opt; "#{name} = 'value'" |
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/env bash | |
set -e | |
# Usage: | |
# ./install-rclone.sh v1.65.0-beta.7390.2a30c417a.fix-b2-upload-url | |
# Check if the argument is supplied | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <rclone_version>" | |
exit 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
option :foo_a | |
option :foo_b, value: {type: Integer} | |
option :bar_x, value: {type: String} | |
option :bar_y | |
option :bar_z, value: {type: Integer} | |
attr_reader :kwargs | |
def self.from_options(options) |
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
class Severity | |
include Comparable | |
attr_reader :value | |
ORDER = %i[low medium high] | |
def self.[](value) | |
new(value) | |
end | |
def initialize(value) |
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
code1 = -> { catch(:foo) { throw(:foo, 'string') } } | |
code2 = -> { begin; raise RuntimeError; rescue RuntimeError; 'string' end } | |
code3 = -> { 'string' } | |
Benchmark.ips do |x| | |
x.report("catch a throw") { | |
value = code1.call | |
} | |
x.report("rescue and exception") { |
NewerOlder