Skip to content

Instantly share code, notes, and snippets.

View Art4's full-sized avatar
🐧
I love free software.

Artur Weigandt Art4

🐧
I love free software.
View GitHub Profile
@lrvick
lrvick / github-troll.md
Last active April 22, 2024 09:12
Trolling Github's DMCA repo with their own security flaws.
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
<?php
namespace JAAulde\IP\V4;
class IpFactory
{
/**
* @var array
*/
private $specs = [
@Art4
Art4 / jsonapi-response-structure.md
Last active August 29, 2015 14:26
Object structure of JSON API 1.0

JSON API Object Structure

Format: JSON API 1.0

This is a structure of all objects in a JSON API response body. This document will be used to build a JSON API Client in PHP. Please leave me a comment if there is something wrong or missing.

Note: This document covers only a possible JSON API response body. A request body can have some exceptions.

Symbols

@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@michaelsauter
michaelsauter / BasePresenter.php
Last active February 6, 2024 12:56
Simple presenter pattern for Symfony2/Twig. Really useful to get some view logic out of the models and views into its own separate space.
<?php
namespace Acme\DemoBundle\Presenter;
class BasePresenter
{
protected $subject;
public function __construct($subject)
{