Skip to content

Instantly share code, notes, and snippets.

module github.com/gobuffalo/buffalo
require (
github.com/dgrijalva/jwt-go v0.0.0-20180308231308-06ea1031745c
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e
github.com/fatih/color v1.7.0
github.com/fatih/structs v1.0.0
github.com/fsnotify/fsnotify v1.4.7
github.com/gobuffalo/envy v1.6.2
github.com/gobuffalo/packr v1.11.0
<?php declare(strict_types=1);
if (
extension_loaded( 'xdebug' )
&& version_compare( '2.6.0', phpversion( 'xdebug' ), '<=' )
)
{
/** @noinspection PhpUndefinedFunctionInspection */
/** @noinspection PhpUndefinedConstantInspection */
xdebug_set_filter(
@guizmaii
guizmaii / aws_postgresql_max_connection.md
Last active April 2, 2024 15:59
AWS PostgreSQL max_connection per instance type

The default formula use by AWS RDS to calculate the max_connections parameter is: LEAST({DBInstanceClassMemory/9531392},5000)

But It's hard to find the exact value of DBInstanceClassMemory.

So, here are the values I got when I ran the SQL commmand: show max_connections; in some RDS instances:

Instance type RAM (GB) max_connections
db.t2.small 2 198
db.t2.medium 4 413
@mthenw
mthenw / README.md
Last active July 4, 2022 16:14
iTerm2 configuration
@bcremer
bcremer / php-class-name-constant-case sensitivity-and-psr-11.md
Last active July 13, 2017 12:40
PHP class name constant (::class) is case insensitive and that might break your PSR-11 container access

PHP´s magic ::class-constant will not canonical the casing of your imports.

This can lead to hard to debug errors when you a using a case sensitive service PSR-11-locator like Zend\ServiceManager.

namespace FirstNamespace;

class TestClass {}
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@peterhellberg
peterhellberg / graceful.go
Last active June 11, 2024 12:27
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@skarllot
skarllot / Makefile.makefile
Created May 3, 2016 21:24
Makefile to merge coverage data from all subpackages (Golang)
.PHONY: test-cover-html
PACKAGES = $(shell find ./ -type d -not -path '*/\.*')
test-cover-html:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea