Skip to content

Instantly share code, notes, and snippets.

View augustohp's full-sized avatar

Augusto Pascutti augustohp

View GitHub Profile
@augustohp
augustohp / git-bacon_ratio.sh
Last active April 24, 2019 07:11
How good is a commit? The bigger the commit message, more thought was put into that commit
#!/bin/sh
CSV_OUTPUT=0
_main()
{
header_printed=""
for commit in $(repository_commits)
do
changed_lines=$(diff_stat_of $commit)
@augustohp
augustohp / github-pandoc.css
Last active December 15, 2017 06:41 — forked from dashed/github-pandoc.css
A GitHub-like CSS for Markdown files rendered in HTML with pandoc.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@augustohp
augustohp / saude-testes.md
Created March 27, 2015 05:26
Post: Como anda a saúde dos seus testes?

Como está a saúde dos seus testes?

Testes automatizados são bons. Eles podem ser melhores? Quanto valor testes automatizados podem acrescentar a sua empresa?

Como está a saúde dos seus testes?

Como num checkup, você pode saber se sua suíte de testes está com uma boa saúde ou não. As respostas às perguntas abaixo podem ajudar:

  1. Eles quebram quando um corportamento muda porque as expectativas deles eram outras?
  2. Eles guiam o desenvolvedor a corrigí-los ao invés de só apontar uma falha?
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Debian-compatible Xvfb startup script.
# Tom Meier <[email protected]>
# Jeffery Fernandez <[email protected]>
#
### BEGIN INIT INFO
# Provides: xvfb_daemon
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
@augustohp
augustohp / code2rtf
Last active March 8, 2016 04:28
Wrapper to `highlight` tool, with sensible defaults and ease to use on directories
#!/usr/bin/env bash
#
# vim: et ts=4 sw=4 ft=sh:
declare -r SCRIPT_NAME=$0
declare -r THEME_LIGHT="Seashell"
declare -r THEME_DARK="Zenburn"
declare -r TAB_SPACES=4
declare -r LINE_NUMBER_COLUMN_LENGTH=4
declare -r OUTPUT_ENCODING=UTF-8
@augustohp
augustohp / mailcatcher.sh
Last active April 24, 2019 07:18 — forked from dakatsuka/mailcatcher.sh
Mailcatcher init script for Debian.
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: mailcatcher
# Required-Start: $local_fs $network $syslog $portmap
# Required-Stop: $local_fs $network $syslog $portmap
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: Start/stop mailcatcher daemon.
### END INIT INFO
@augustohp
augustohp / run.php
Created May 30, 2014 02:30
Usar array estoura a memória do PHP.
<?php
function printResults()
{
$startOfRequest = $_SERVER['REQUEST_TIME'];
$memoryUsed = formatBytes(memory_get_usage());
$memoryPeak = formatBytes(memory_get_peak_usage());
echo <<<EOT
Memory usage: $memoryUsed
Memory peak: $memoryPeak
@augustohp
augustohp / custom-respect-validation-rules.md
Last active March 24, 2022 17:24
How to create custom Respect\Validation rules.

Custom rules on Respect/Validation

You may not know that [the most awesome validation engine for PHP][1] out there is [Respect/Validation][2]. If you do, this is tailored for you!

All rules on [Respect/Validation][2] are meant to be used together, composing a more complex validation rule that is closer to the domain of your application than the existing ones, let's try an example:

@augustohp
augustohp / jekyll
Last active August 29, 2015 14:00
Jekyll init script for debian (serves Ubuntu).
#!/bin/bash
#
# Jekyll is a Ruby based website/blog generator, this is his
# (unnoficial) init script. Tested with Jekyll 1.5.
# Author: Augusto Pascutti <[email protected]>
set -o errexit
set -o pipefail
[[ $DEBUG ]] && set -x

Keybase proof

I hereby claim:

  • I am augustohp on github.
  • I am augustohp (https://keybase.io/augustohp) on keybase.
  • I have a public key whose fingerprint is BC17 089B E946 FA41 10BE 422F 0C63 DBDD 93E2 C95D

To claim this, I am signing this object: