Skip to content

Instantly share code, notes, and snippets.

irb(main):035:0> s = Set.new
=> #<Set: {}>
irb(main):036:0> a = Set.new([1,2,3])
=> #<Set: {1, 2, 3}>
irb(main):037:0> b = Set.new([1,2,3])
=> #<Set: {1, 2, 3}>
irb(main):038:0> s.add(a)
=> #<Set: {#<Set: {1, 2, 3}>}>
irb(main):039:0> s.include?(b)
=> true
{"schemaVersion":1,"label":"Stars","message":"null","color":"yellow"}
@pcorliss
pcorliss / yahoo-pre-draft.js
Created September 8, 2021 16:16
Populates Yahoo's Pre-Draft Rankings with a CSV
// 1. Download CSV of Fantasy Pros Draft Rankings https://www.fantasypros.com/nfl/rankings/half-point-ppr-cheatsheets.php
// 2. Paste into rankingCSV below
// 3. Navigate to Edit Pre-Draft Rankings Page on Yahoo
// 4. Paste below into Chrome Console
// 5. Wait for All Players to be loaded (951)
// 6. Run go()
// 7. Wait about an hour
// 8. Save Changes
(function loadPlayers() {
# Generate a random hex token with 256 bits, turn it into raw bytes
require 'jwt'
irb(main):013:0> token = rand(2**256).to_s(16)
irb(main):014:0> token
=> "625e3c0b7ed292952988ff403885d6a5718370a13625473984f152606a82e47e"
irb(main):015:0> [token].pack("H*")
=> "b^<\v~\xD2\x92\x95)\x88\xFF@8\x85\xD6\xA5q\x83p\xA16%G9\x84\xF1R`j\x82\xE4~"
irb(main):016:0> [token].pack("H*")
class Array
def merge_sorted(other)
i = 0
j = 0
sorted = []
while(i < self.length || j < other.length) do
l = self[i]
m = other[j]
if l.nil? || l >= m
sorted << m
ip-10-254-32-217:~/cosmos/aws_connectivity pcorliss@master M:3 % ruby lib/conn.rb
Connected to AWS
ec2: #<Fog::Compute::AWS::Real:0x00000002f0eec8>
SSHing to Servers |Time: 00:00:05 | ================================================================================================================== | Time: 00:00:05
ID | NAME                       | PRIV_IP      | STATE   | LISTENING
---|----------------------------|--------------|---------|----------
0  | Cassandra Non Seed Node 1  | 10.42.19.54  | running | false
1  | Cassandra Non Seed Node 2  | 10.42.22.70  | running | false
2  | Cassandra Non Seed Node 3  | 10.42.26.218 | running | false
@pcorliss
pcorliss / debian-jessie-not-working.log
Created March 24, 2015 19:50
A working and non-working example of ubuntu 12.04 versus debian jessie. Fix is to remove the data-dir and start from scratch
admin@ip-172-31-16-81:~$ sudo /usr/local/bin/consul agent -server -config-dir /etc/consul.d -data-dir /mnt/consul -bind=172.31.16.81 -bootstrap-expect=1
==> WARNING: BootstrapExpect Mode is specified as 1; this is the same as Bootstrap mode.
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
Node name: 'ip-172-31-16-81'
Datacenter: 'dc1'
Server: true (bootstrap: true)

Keybase proof

I hereby claim:

  • I am pcorliss on github.
  • I am pcorliss (https://keybase.io/pcorliss) on keybase.
  • I have a public key whose fingerprint is 81BD B279 1750 0770 D24D 1D0E 748E E5F2 91E2 AC19

To claim this, I am signing this object:

Remote Address:204.109.13.115:443
Request URL:https://www.braintreepayments.com/create-merchant
Request Method:POST
Status Code:403 Forbidden
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive