Skip to content

Instantly share code, notes, and snippets.

View thefotios's full-sized avatar
definitely snacking

Fotios Lindiakos thefotios

definitely snacking
View GitHub Profile
thefotios /
Last active August 18, 2023 20:07
tax stuff

tax_category_name array_agg Amino Acids {"Sample Kit - Plant Protein","Sample Kit - Super Plants","Whey Protein - Chocolate Tub (Unpersonalized)","Whey Protein - Chocolate Tub","Sample Kit - Vanilla Protein","Sample Kit - Whey Protein","Sample Kit - Chocolate Protein","Whey Protein - Vanilla Tub (Unpersonalized)","Whey Protein - Chocolate Sachet","Plant Protein - Chocolate Sachet","Plant Protein - Chocolate Tub","Plant Protein - Chocolate Tub (Unpersonalized)","Plant Protein - Unflavored Sachet","Plant Protein - Unflavored Tub","Plant Protein - Unflavored Tub (Unpersonalized)","Plant Protein - Vanilla Sachet","Plant Protein - Vanilla Tub","Plant Protein - Vanilla Tub (Unpersonalized)","Whey Protein - Vanilla Tub","Whey Protein - Vanilla Sachet"}"

Herbal Supplements {Turmeric,"Milk Thistle",Cranberry,Garlic,"Cranberry 2","Ashwagandha 3 (Vegan)","Ashwagandha Bottle (Vegan)",Ashwagandha,"American Ginseng","Maca Sachet",Rhodiola,"Rhodiola 2","Rhodiola 3","Rhodiola 3 Alternative","Rhodiola 3 (Alternative)","Rhodi

thefotios /
Created August 17, 2023 14:28
Test YAML preamble
foo baz

This document has a preamble of

foo: bar
baz: zing
it 'creates the credits to the user' do
order.user.store_credits.where(category: MultiMonthCommit.store_credit_category).map(&:amount),
).to match_array(expected_credits)
thefotios / visualize_query.rb
Created January 18, 2022 22:27
Format and visualize AR queries using
class VisualizeQuery
# Takes an AR relation (query), runs explain, and then uploads it to
# for better visualization
# The query is also nicely formatted before visualizing using
# - 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]
thefotios / verified_double_extensions.rb
Last active July 31, 2020 16:04
Allow instance_double's to pass class equivalence checks (see
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|
allow(dbl).to receive(fn) do |*fn_args|
klass.allocate.send(fn, *fn_args)

Backpopulation Time

thefotios / TCP Socket
Last active August 25, 2016 20:10
TCP Socket Availability

TCP Socket Availability

"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": "",
"AllowedPattern": "^([0-9]+\\.){3}[0-9]+\\/[0-9]+$",
"MinLength": "9",
thefotios / .node-version
Last active December 11, 2015 22:23