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 'httparty' | |
require 'uri' | |
require 'csv' | |
def get_incidents | |
limit = 100 | |
url = "https://api.pagerduty.com/incidents?statuses%5B%5D=resolved&time_zone=UTC&limit=#{limit}&offset=" | |
incidents = [] | |
offset = 0 |
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
# gem install google-api-client | |
require "google/apis/calendar_v3" | |
require "googleauth" | |
require "googleauth/stores/file_token_store" | |
require "date" | |
require "fileutils" | |
OOB_URI = "urn:ietf:wg:oauth:2.0:oob".freeze | |
APPLICATION_NAME = "Google Calendar API Ruby Quickstart".freeze |
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
def log_object(job_id, step_id, bucket, key) | |
puts ['found', job_id, step_id, bucket, key].join(',') | |
end | |
def log_missing(job_id, object_id, msg) | |
puts ['missing', job_id, object_id, msg].join(',') | |
end | |
# Finding the offending RfTests | |
rf_test_ids = RfTest.where(client_id: 5627) |
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 'httparty' | |
require 'json' | |
require 'byebug' | |
def get_data | |
query = File.open('repos.graphql', 'r').read | |
token = 'https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/' | |
cursor = nil | |
repos = [] | |
org = 'evil_mega_corp' |
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
$ echo '{"foo": "bar"}' | curl --unix-socket /tmp/foo.bar http://www.google.com/echo -d @- | |
{"message":"{\"foo\": \"bar\"}"} | |
$ curl --unix-socket /tmp/foo.bar http://www.google.com/popper | |
{"message":"🎉"} |
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
$ echo '{"foo": "bar"}' | curl --unix-socket /tmp/foo.bar http://www.google.com/echo -d @- | |
{"message":"{\"foo\": \"bar\"}"} | |
$ curl --unix-socket /tmp/foo.bar http://www.google.com/popper | |
{"message":"🎉"} |
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
export HOST=foo.example.com | |
# Create a new CSR + key | |
# If you want a more complicated subject, '/' seperate the fields | |
openssl req -nodes -keyout "$HOST.key" -out "$HOST.csr" -new -subj "/CN=$HOST" | |
# Create a new CSR + key with SAN | |
echo -e "[SAN]\nsubjectAltName=DNS:$HOST,DNS:${HOST/foo/bar}\n" | \ | |
cat /etc/ssl/openssl.cnf - | \ | |
openssl req -nodes -keyout "$HOST.key" -out "$HOST.csr" -new -subj "/CN=$HOST" -reqexts SAN -config /dev/stdin |
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
var page = require('webpage').create(); | |
page.open('https://enterprise.google.com/chrome/chrome-browser/', function(status) { | |
console.log("Status: " + status); | |
if(status === "success") { | |
var winVer = page.evaluate(function() { | |
return document.querySelector("#download span[ng-bind='win64Version']").innerHTML; | |
}); | |
var macVer = page.evaluate(function() { | |
return document.querySelector("#download span[ng-bind='macVersion']").innerHTML; | |
}); |
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 "selenium-webdriver" | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
#profile['devtools.errorconsole.enabled'] = false | |
profile['devtools.chrome.enabled'] = false | |
profile['devtools.errorconsole.enabled'] = false | |
%w[css csserror csslog cssparser error exception info jslog jswarn log netwarn network networkinfo netxhr secerror secwarn serviceworkers sharedworkers warn windowlessworkers].each do |m| | |
profile["devtools.browserconsole.filter.#{m}"] = false | |
end |
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
# Sets | |
ℕ = set of positive integers | |
ℤ = set of all integers | |
ℂ = set of all complex numbers | |
ℝ = set of all real numbers | |
ℚ = set of all rational numbers | |
∅ = {} | |
H = { x | ℕ > 1 } == H is the set of all postive integers greater than 1 (| == 'such that') | |
x ∈ ℕ == x belongs to ℕ |
NewerOlder