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
| def test(one, str, two) | |
| puts str | |
| end | |
| test(3, <<EOM, 6) | |
| This is a multiline string in some madness version fo the format | |
| EOM |
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
| #!/bin/bash | |
| touch readysetgo | |
| clear | |
| while [ -f readysetgo ]; do | |
| sleep 0.1 | |
| done | |
| sl |
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
| # According to RFC1123 the following characters may appear in a host name: | |
| # | |
| # * A to Z ; upper case characters | |
| # * a to z ; lower case characters | |
| # * 0 to 9 ; numeric characters 0 to 9 | |
| # * - ; dash | |
| # | |
| # Additionally the host name must obey the following rules: | |
| # | |
| # * A host name (label) can start or end with a letter or a number |
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
| module Klass | |
| def self.counter | |
| Thread.current[:counter] ||= 0 | |
| end | |
| def self.counter=(value) | |
| Thread.current[:counter] = value | |
| end | |
| def self.yield_with_counter |
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
| #!/bin/bash | |
| OVERRIDE_PATH="./lib_overrides" | |
| COMMAND="${1}"; shift | |
| ARGUMENTS="$@" | |
| mkdir -p ${OVERRIDE_PATH} | |
| # Ensure the host file exists at our new location |
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
| # Generate a list of all the possible port numbers with 1/80 randomly removed | |
| # from the list. | |
| ar = (1...(2 ** 16)).to_a.select { |i| rand(80) != 0 } | |
| # Build a summary of the list | |
| prev = ar[0] | |
| summary = ar.slice_before do |e| | |
| prev, prev2 = e, prev | |
| prev2.succ != e | |
| end.map do |a| |
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
| #!/usr/bin/env ruby | |
| require 'openssl' | |
| DEFAULT_INTERVAL = 30 | |
| module Base32 | |
| Base32Error = Class.new(RuntimeError) | |
| CHARS = "abcdefghijklmnopqrstuvwxyz234567".each_char.to_a |
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
| source "https://rubygems.org" | |
| gem 'nokogiri' | |
| gem 'ruby_kml' |
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
| #!/usr/bin/env ruby | |
| require 'csv' | |
| require 'liquid' | |
| require 'ostruct' | |
| module Engine | |
| def self.compound(name = nil, &blk) | |
| rule_list.push(CompoundRule.new(name, &blk)) | |
| end |
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
| def retry_block | |
| retry_count ||= 0 | |
| yield | |
| rescue => e | |
| retry_count += 1 | |
| if retry_count >= 5 | |
| puts "Fatal aborting..." | |
| raise e | |
| else | |
| puts "Error #{retry_count}: #{e.message}" |