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
  • 07:53 (UTC +02:00)
View GitHub Profile

Benchmarking Nginx with Go

Today I just wanted to know which of these options is faster:

  • Go HTTP standalone
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI

Hardware

class Allocator
# override new class method
def self.new(*args)
print "Hello "
ref = allocate
ref.send(:initialize, *args)
print "\n"
return ref
end
--- module ScottsSnake where
import Keyboard
import Random
import String
import Set
type Position = {x: Int, y: Int }
type Board = {w: Int, h: Int, wall: [Position]}
type Apple = Position
@alex-quiterio
alex-quiterio / puddles.go
Created August 3, 2014 00:14
Simple programming exercise with unionSets
package main
import "fmt"
type Set struct {
pos int
value int
}
func makeSet(position int, value int) Set {
@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,
# A web crawler in Ruby
#
# This script provides a generic Spider class for crawling urls and
# recording data scraped from websites. The Spider is to be used in
# collaboration with a "processor" class that defines which pages to
# visit and how data from those pages should be consumed. In this example
# the processor is ProgrammableWeb.
#
# Usage:
# spider = ProgrammableWeb.new
@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)
@alex-quiterio
alex-quiterio / mock.ts
Last active February 18, 2025 08:29
A generic mocking util function for your tests
type UnmockableTypes =
| Number
| Boolean
| String
| Symbol
| BigInt
| Date
| RegExp
| Generator;
// voronoi-organic-generator.ts
interface Point {
x: number;
y: number;
}
interface VoronoiCell {
site: Point;
vertices: Point[];