Skip to content

Instantly share code, notes, and snippets.

🏂
Working...

Matt Humphrey m4tthumphrey

🏂
Working...
Block or report user

Report or block m4tthumphrey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am m4tthumphrey on github.
  • I am m4tthumphrey (https://keybase.io/m4tthumphrey) on keybase.
  • I have a public key ASCPU08sRfv13I-0U4icO5HUvPchBubdlvdCuY6BOFnC4Qo

To claim this, I am signing this object:

View gist:96b785f1270836ad349a72d1cb79040a
<?php namespace ContractsBundle\Dbal\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
class JsonSerializable extends Type
{
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return 'json';
View src-bundle-ServiceBoots.php
<?php
// this should be called the first time 'manager' is resolved from the container
$container->get('manager')->registerPolicy(new Policy());
@m4tthumphrey
m4tthumphrey / cstatus.sh
Created Aug 14, 2015
Quick command for checking for dirty git repositories inside of a composer vendor directory. Move file somewhere in your path and run `cstatus <vendor name>` to get a list of any dirty repositories.
View cstatus.sh
curdir=$(pwd)
vendor=$1
for f in $curdir/vendor/$vendor/*; do
[ -d $f ] && cd "$f" && output=$(git status --porcelain) && [ "$output" != "" ] && echo "$f" && echo "$output"
done;
View gist:25ada63b93b96e9c330c
<?php
//...
$called = false;
$manager->expire(function(FileType $type, Collection $collection) use (&$called) {
$called = true;
});
@m4tthumphrey
m4tthumphrey / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:898d7d1f7587dfb1c3d7
module.exports = {
entry: './js/app.js',
output: {
filename: './js/bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'jsx?harmony'
View gist:6a0b93d05235613a3711
render: function() {
var { className, ...other } = this.props;
var fulClassName = 'toolbox2-modal-content toolbox2-modal-' + className;
return (
<div className="toolbox2-modal-backdrop" onClick={this.handleBackdropClick} {...other}>
@m4tthumphrey
m4tthumphrey / ConcatAudioFilter.php
Last active Mar 13, 2019
php-ffmpeg concat audio filter - an incredibly simple filter to concat multiple audio files together. Should be easily tweaked to allow for videos too.
View ConcatAudioFilter.php
<?php
use FFMpeg\Media\Audio;
use FFMpeg\Format\AudioInterface;
use FFMpeg\Filters\Audio\AudioFilterInterface;
class ConcatAudioFilter implements AudioFilterInterface
{
private $files;
private $priority;
@m4tthumphrey
m4tthumphrey / streamed.php
Last active Jul 23, 2017
Laravel response macro for streamed responses with seeking support
View streamed.php
<?php
Response::macro('streamed', function($type, $size, $name, $callback) {
$start = 0;
$length = $size;
$status = 200;
$headers = [
'Content-Type' => $type,
'Content-Length' => $size,
You can’t perform that action at this time.