View visualize_query.rb
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 VisualizeQuery | |
# Takes an AR relation (query), runs explain, and then uploads it to | |
# https://explain.dalibo.com for better visualization | |
# | |
# The query is also nicely formatted before visualizing using https://github.com/darold/pgFormatter | |
# - This is run via `docker` | |
# - If the placeholders are sensitive (for instance emails in a 'where' clause) | |
# you can pass `anonymize: true` and they'll be replaced with random strings | |
method_object :query, [title: nil, anonymize: false] |
View verified_double_extensions.rb
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
module VerifiedDoubleExtensions | |
CLASS_EQUIVALENCE_FUNCTIONS = %i[is_a? kind_of? instance_of?].freeze | |
def verified_double(klass, *args) | |
instance_double(klass, *args).tap do |dbl| | |
CLASS_EQUIVALENCE_FUNCTIONS.each do |fn| | |
allow(dbl).to receive(fn) do |*fn_args| | |
klass.allocate.send(fn, *fn_args) | |
end | |
end |
View TCP Socket Availability.carbide.md
TCP Socket Availability
View dcos.json
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"PublicSubnet": { | |
"Description": "Subnet ID for use by all public agent nodes", | |
"MaxLength": "18", | |
"ConstraintDescription": "must be a valid CIDR.", | |
"Default": "0.0.0.0/0", | |
"AllowedPattern": "^([0-9]+\\.){3}[0-9]+\\/[0-9]+$", | |
"MinLength": "9", |
View .node-version
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
4.2.2 |
View day1.sh
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
# Part 1 | |
awk 'BEGIN{ FS = ""} {for(i = 1; i <= NF; i++) if($i ~ /\(/){ floors++}else{floors--} } END { print floors}' | |
# Part 2 | |
awk 'BEGIN{ FS = ""} {for(i = 1; i <= NF; i++){ if($i ~ /\(/){ floors++}else{floors--}; if(floors < 0){print i; break}}} END { print floors}' |
View emojify.sh
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 | |
url=$1; | |
output=${2-output.png}; | |
size=${3-128}; | |
curl --silent -kL $url | convert - -resize ${size}x${size} $output; |
View keybase.md
Keybase proof
I hereby claim:
- I am thefotios on github.
- I am thefotios (https://keybase.io/thefotios) on keybase.
- I have a public key whose fingerprint is 2264 2751 B5AD E6D2 DC85 FA4A 91BD C79C 39F3 48FD
To claim this, I am signing this object:
View talks.md
OSCON 2013 Talks
- Moose: A Guide to the New Revolution
- dl.google.com: powered by Go
- Build Your Own PaaS
- Exploiting your File System to Build Robust & Efficient Workflows
- Kicking Impostor Syndrome In the Head
- Giving LWP::UserAgent Its Well Deserved Golden Watch
- Carton: Manage CPAN dependencies without the mess
- Discrete Math You Need to Know
- GitHub Power Tools
NewerOlder