Skip to content

Instantly share code, notes, and snippets.

View motin's full-sized avatar

Motin motin

View GitHub Profile
@motin
motin / AppJson.php
Created December 19, 2017 14:47
Handle JSON decoding/encoding app-wide in a specific manner
<?php
/**
* Handle JSON decoding/encoding app-wide in a specific manner
*
* Class AppJson
*/
class AppJson
{
@motin
motin / Auth0ManagementApiClient.php
Created December 19, 2017 14:45
Example usage:
<?php
namespace api_clients;
use Auth0JwtBootstrap;
use AppJson;
class Auth0ManagementApiClient
{
@motin
motin / Auth0ManagementApiClient.php
Created December 19, 2017 14:45
Example usage:
<?php
namespace api_clients;
use Auth0JwtBootstrap;
use AppJson;
class Auth0ManagementApiClient
{
<?php
/**
* Helper trait to throw an exception instead of getting affected by Propel's automagic cross-join-"fixing" of a query.
* Most often, the cross join is an unwanted consequence of a typo or incorrect usage of the query methods related to relation aliases.
*
* Use this trait in the *Query classes and manually execute the following method on query objects wherever automatic cross joins are unwanted:
*
* $query->throwExceptionIfPropelCrossJoinQueryFixWillBeTriggered();
*
#!/usr/bin/env bash
set -o errexit
#set -x
echo "Benchmark - dd if=/dev/zero of=speedtest bs=1024 count=100000"
echo "* On host"
time dd if=/dev/zero of=speedtest bs=1024 count=100000
echo
@motin
motin / composer.json
Created July 20, 2016 09:33
I got a completely hung composer update after having added league/flysystem-aws-s3-v3. no error message, just stuck on “Resolving dependencies through SAT”. It would not work unless I removed 2amigos/resource-manager from the dependencies. Here is the file to reproduce the problem
{
"name": "vendor/name",
"description": "Description",
"type": "library",
"authors": [
{
"name": "Fredrik Wollsén",
"email": "fredrik@neam.se",
"homepage": "http://www.neam.se"
},
<?php
use Codeception\Util\Stub;
class StringTransliterationTest extends \Codeception\TestCase\Test
{
use DnaTestTrait;
/**
* @var \CodeGuy
@motin
motin / out.txt
Created April 12, 2016 14:39
Output from https://gist.github.com/motin/cca880c647263eb5e98d9f1e0d60a3c5 on Docker 1.8.3 running on Debian
+ docker version
Client:
Version: 1.8.3
API version: 1.20
Go version: go1.4.2
Git commit: f4bf5c7
Built: Mon Oct 12 18:01:15 UTC 2015
OS/Arch: linux/amd64
Server:
@motin
motin / out.txt
Last active April 12, 2016 14:39
Output from https://gist.github.com/motin/cca880c647263eb5e98d9f1e0d60a3c5 for Docker 1.10.3 running on OSX
+ docker version
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: darwin/amd64
Server:
@motin
motin / Dockerfile
Last active March 6, 2022 18:07
Run "git clone https://gist.github.com/cca880c647263eb5e98d9f1e0d60a3c5.git replicate-docker-issue-21950 && bash replicate-docker-issue-21950/replicate-docker-issue-21950.sh" to replicate https://github.com/docker/docker/issues/21950
FROM busybox
COPY . /