Skip to content

Instantly share code, notes, and snippets.

Verifying that +greg0ire is my blockchain ID. https://onename.com/greg0ire

Keybase proof

I hereby claim:

  • I am greg0ire on github.
  • I am greg0ire (https://keybase.io/greg0ire) on keybase.
  • I have a public key whose fingerprint is 21EA 01EE 4666 524E 353F 72CE F302 26DD 290F CB25

To claim this, I am signing this object:

@greg0ire
greg0ire / phpDocDuh
Created January 10, 2017 19:27
php doc : towards a minimum?
<?php
/**
* @param A $a useful comment
* @param B $b useless comment
* @param C|null $c useful comment
*/
function muchDocumented(A $a, B $b, C $c = null)
{
}
@greg0ire
greg0ire / pagination.md
Last active May 20, 2018 16:42
Pagination

Pagination

Pagination is the process of dividing a long list of results into easier to consume pages. By only loading one page at a time, memory is preserved. This applies to RDBMS result sets, collections of serialized items in an API, or listings in list views of simple CRUD applications. Although the needs are often the same, many libraries define their own objects, or even use plain arrays to represent a paginated result. As a result, projects consuming these libraries often end up defining many adapters for those many libraries.

@greg0ire
greg0ire / composer-test-my-pr
Last active March 25, 2019 18:23
How to quickly provide a markdown help test for people who want to test your PR
#!/bin/bash
#
# Assumes you are in the directory of a Composer project, on the branch of your
# PR, and that the PR is on Github
function usage()
{
echo "Usage: $1 nickname"
echo "Example: $1 greg0ire"
exit 1
#!/bin/bash -e
function usage () {
echo "$1" duration oldest-branch … newest-branch
exit 1
}
function count_commits() {
log_args[0]="origin/$2"
if [ $# -eq 3 ]
@greg0ire
greg0ire / infiniba.sh
Last active July 3, 2021 14:10
Infinidash reimplemented in less than 100 lines of bash
#!/bin/bash
yes '-'