Skip to content

Instantly share code, notes, and snippets.

@CodingAnarchy
CodingAnarchy / nokogiri_test.eml
Created January 28, 2021 16:52
Email that breaks nokogiri parsing
Return-Path: <SentinelAlerts@foobar.com>
Received-SPF: pass (spfCheck: domain of foobar.com designates 192.168.0.1 as permitted sender) client-ip=192.168.0.1; envelope-from=SentinelAlerts@foobar.com; helo=mail-dm6nam10on2114.outbound.protection.outlook.com;
Authentication-Results: amazonses.com;
spf=pass (spfCheck: domain of foobar.com designates 192.168.0.1 as permitted sender) client-ip=192.168.0.1; envelope-from=SentinelAlerts@foobar.com; helo=mail-dm6nam10on2114.outbound.protection.outlook.com;
dkim=pass header.i=@foobar.com;
dmarc=pass header.from=foobar.com;
X-SES-RECEIPT: AEFBQUFBQUFBQUFFOG93TThhdmZYL0dpV1l4dXpSblIyODRaMGdtVGU3QVF5UW9SKzc3aE9jbU5LL3dxdmJXYUNnaHZBMGtOdGNxK1kxZ2NKTHJXWGdNVGZKS1kwUGJyNlRHNjRqdjN4ZVJSUHlQRjlvb1lSN1NObzBEcEN3OHNJejdmQThZQStYbHBBK2xtWEZSSUQ5V0dwdUk2RzBJeFpjLzNjdS9hTjVJSjlpN1AraUxicnBxQUFJZ0VTTEtWZ1RzSkpiRGtNb2cyQkVnY25xOGZkZEorTzhkbXVZMFlKTnFWSGpTQTI2VnY5QW1ER2srY3I2N3NTc3F6dG5McFVPSTJ6ZU90c2NzT1BJUlA5YkR1MmVDQkV2VUdkUDRlcEZ2Mm1qUU0reFJjeWhzQ1BPS0sweVN4NFgzRndWOG96QVFRek1
@CodingAnarchy
CodingAnarchy / flatten_experiment.rb
Last active June 27, 2019 01:43
Memory profiling flatten.compact vs flatten!+compact!
require 'gnuplot'
require 'benchmark'
require 'benchmark-memory'
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.title "flatten performance"
plot.ylabel "MB used"
plot.xlabel "array sizes"
@CodingAnarchy
CodingAnarchy / recursive_flatten.rb
Created September 25, 2018 15:56
Recursive flatten
def flatten(array, results = [])
array.each do |element|
if element.class == Array
flatten(element, results)
else
results << element
end
end
results
end

Environment

Bundler   1.15.3
Rubygems  2.6.10
Ruby      2.2.6p396 (2016-11-15 revision 56800) [x86_64-darwin16]
GEM_HOME  /Users/vision/.rvm/gems/ruby-2.2.6
GEM_PATH  /Users/vision/.rvm/gems/ruby-2.2.6:/Users/vision/.rvm/gems/ruby-2.2.6@global
RVM       1.29.2 master
Git       2.14.1
@CodingAnarchy
CodingAnarchy / # gcc - 2016-04-11_19-26-16.txt
Last active April 12, 2016 23:08
gcc on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for gcc on Mac OS X 10.11.4
Build date: 2016-04-11 19:26:16
@CodingAnarchy
CodingAnarchy / atom_updater.sh
Created June 26, 2015 23:43
Atom Updater for Fedora (tired of manual updates!)
#!/bin/bash
rm atom.x86_64.rpm*
atom_version=`atom --version`
latest_tag=`git ls-remote --tags https://github.com/atom/atom.git | tail -n 1 | cut -f 2`
latest=`basename $latest_tag`
latest=`echo $latest | sed 's/^v//'`
# echo $atom_version
# echo $latest
@CodingAnarchy
CodingAnarchy / keybase.md
Last active August 29, 2015 14:13
Keybase Identity Verification

Keybase proof

I hereby claim:

  • I am codinganarchy on github.
  • I am thorodinson (https://keybase.io/thorodinson) on keybase.
  • I have a public key whose fingerprint is 2A1F 808E 40AB 29A5 E94A 7362 5D78 AD91 2167 F70C

To claim this, I am signing this object: