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
| 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 |
| package main | |
| import "fmt" | |
| type Set struct { | |
| pos int | |
| value int | |
| } | |
| func makeSet(position int, value int) Set { |
| #!/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 |
| #!/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: |
Magic words:
psql -U postgresSome 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)| 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[]; |