Skip to content

Instantly share code, notes, and snippets.

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCsvDataTable extends Migration
{
/**
* Run the migrations.
@johnpbloch
johnpbloch / powerline-jpb.base.bash
Created August 4, 2017 17:03
My custom theme for bash_it based on powerline multiline
. "$BASH_IT/themes/powerline-multiline/powerline-multiline.base.bash"
function __powerline_docker_compose_prompt {
local prompt
if docker-compose config &>/dev/null
then
prompt+="${DOCKER_CHAR}"
else
return
fi
<?php
// Let's get a list of Post IDs that have given post meta item matching a pattern, but we only want unique values
// And we want the items ordered correctly so that keys aren't skipping numbers, etc.
$post_ids = array_values( array_unique( wp_list_pluck( array_filter( (new WP_Query(['posts_per_page' => -1]))->posts, function($post) {
return (bool) preg_match( '/some-pattern/i', $post->some_meta_value );
} ), 'ID' ) );
@johnpbloch
johnpbloch / Dockerfile
Created November 5, 2016 20:17
Kibana with Sense installed
FROM kibana:4.5
RUN gosu kibana /opt/kibana/bin/kibana plugin --install elastic/sense
<?php
// Assuming https://wiki.php.net/rfc/arrow_functions makes it into PHP core, we can do this:
class Arr extends ArrayObject
{
static function make($array)
{
return new self($array);
}
<?php
/** @var int $start The start timestamp */
/** @var int $end The end timestamp */
$days = ceil( abs( $end - $start ) / DAY_IN_SECONDS );
if ( date( 'Ymd', $start ) !== date( 'Ymd', $end ) ) {
$days += 1;
}
{
"name": "10up",
"hostname": [
"10up.dev",
"www.10up.dev"
],
"maintainers": [
{
"name": "Taylor Lovett",
"email": "taylor.lovett@10up.com"
{
"name": "johnpbloch/test-4",
"license": "MIT",
"authors": [
{
"name": "John P Bloch",
"email": "me@johnpbloch.com"
}
],
"repositories":[
/vendor/
/vendor/