Skip to content

Instantly share code, notes, and snippets.

View alex-quiterio's full-sized avatar
🌀
rise to see and not to be seen

aIex quiterio alex-quiterio

🌀
rise to see and not to be seen
  • Seenons
  • Amsterdam
  • 05:25 (UTC +01:00)
View GitHub Profile
@alex-quiterio
alex-quiterio / proxy.rb
Last active August 29, 2015 14:21 — forked from torsten/proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@alex-quiterio
alex-quiterio / gist:c1642b78918da9479439
Last active August 29, 2015 14:28 — forked from josetapadas/gist:f9eec8ca7d9f214f0918
Dynamic single shot media query
var mediaQueryListElement = window.matchMedia("all and (min-width: 666px)");
function call_me(name) {
console.log("És um " + name);
mediaQueryListElement.removeListener(call_me.caller);
}
mediaQueryListElement.addListener(function() {
call_me("sugar");
});
@alex-quiterio
alex-quiterio / mysql.database.yml
Created April 24, 2021 17:56 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@alex-quiterio
alex-quiterio / ecs-run
Created July 15, 2021 05:33 — forked from vcastellm/ecs-run
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@alex-quiterio
alex-quiterio / postgres-cheatsheet.md
Created May 31, 2022 08:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)