Skip to content

Instantly share code, notes, and snippets.

@gecbla
gecbla / jq-cheetsheet.md
Created November 18, 2021 19:42 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@gecbla
gecbla / guzzle-retry.php
Created June 24, 2018 18:08 — forked from gunnarlium/guzzle-retry.php
Example of how to create a retry subscriber for Guzzle 6
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request as Psr7Request;
use GuzzleHttp\Psr7\Response as Psr7Response;
use Psr\Log\LoggerInterface;
const MAX_RETRIES = 2;
@gecbla
gecbla / jtt.php
Created May 16, 2018 17:45 — forked from iansltx/jtt.php
Quick CLI for adding work log times in JIRA
#!/usr/bin/env php
<?php
if ($argc < 3) {
die("Usage: ./jtt.php ISSUE-1 30m optional comment here\n");
}
$username = 'EMAIL_GOES_HERE';
$token = 'API_KEY_HERE'; // see https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-basic-authentication/
$team = 'TEAM_NAME_HERE';
@gecbla
gecbla / gist:acb0a0e12f9b79b42514
Created March 17, 2016 20:30 — forked from tabacitu/gist:dbcfd71375e72c857474
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@gecbla
gecbla / EventGenerator.php
Created January 7, 2016 18:15 — forked from rosstuck/EventGenerator.php
Simple EventGenerator trait that you might use with domain events
<?php
trait EventGenerator
{
protected $pendingEvents = array();
protected function raise($event)
{
$this->pendingEvents[] = $event;
}
@gecbla
gecbla / gist:7af33acfddee631b969c
Created December 15, 2015 22:29 — forked from llbbl/gist:b08ed19281c06483242b
Howto Add PhpStorm to Ubuntu Unity Launcher

PhpStorm 7.0x

Create a file ~/.local/share/applications/jetbrains-phpstorm.desktop

With the following value:

@gecbla
gecbla / bash.sh
Last active August 29, 2015 14:23 — forked from hugocf/bash.sh
#!/usr/bin/env bash
# Created by Hugo Ferreira <hugo@mindclick.info> on isoD.
# Copyright (c) 2012 Mindclick. All Rights Reserved.
# Licensed under the BSD License: http://creativecommons.org/licenses/BSD
readonly BASEDIR=$(cd "$(dirname "$0")" && pwd) # where the script is located
readonly CALLDIR=$(pwd) # where it was called from
readonly STATUS_SUCCESS=0 # exit status for commands
# Script configuration
@gecbla
gecbla / vagrant
Last active March 7, 2016 18:30 — forked from suplo/vagrant
# Vagrant Documentation
# @see http://docs.vagrantup.com/v2/cli/package.html
# @see http://stackoverflow.com/questions/19094024/is-there-any-way-to-clone-a-vagrant-box-that-is-already-installed
# <command-1>
vagrant package --base <virtual-box-name-or-uuid> ^
--output </path/to/package-name.box:package.box>
# <command-2>
vagrant box add --name <box-name> ^
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.

Step 1

Open the file app/config/session.php and change the driver to database.

Step 2

We need to create the sessions table, so use the following artisan command php artisan session:table to generate the migration file.

Step 3