Skip to content

Instantly share code, notes, and snippets.

View alexbowers's full-sized avatar

Alex Bowers alexbowers

View GitHub Profile
@alexbowers
alexbowers / readme.md
Last active March 24, 2016 21:38
Laravel Homestead with Parallels
@alexbowers
alexbowers / Prime For Refactor
Created July 29, 2016 00:16
Refactor to Collection Example for Adam
<?php
foreach($data['rules'] as &$rule) {
if($rule['type'] == RulesModel::$types['category']) {
$category = Category::getList($rule['simple_model_id']);
if(!empty($category)) {
$data['categories'][] = $category;
} else {
$rules_removed['categories']++;
<?php
class UserController
{
Storage::disk('s3-bucket-1')->put('file.txt', '...');
}
@alexbowers
alexbowers / Annotation.php
Last active October 19, 2016 15:47
Fire annotations into Grafana in PHP using UDP.
<?php
class Annotation
{
private $ip = 'Your IP';
private $port = '8089';
/**
* Annotation constructor.
*
<?php
class Collection implements ArrayAccess, Arrayable, ...
{
protected $items = [];
public function __construct(array $items = [])
{
$this->items = $items;
}
<?php
class Collection implements Castable
{
protected $items = [];
public function __construct(array $items = [])
{
$this->items = $items;
}
let original_console = window.console;
let console = Object.create(window.console);
console.log = function(msg, formatting) {
formatting = formatting || '';
console.groupCollapsed();
console.trace();
original_console.log(msg, formatting);
console.groupEnd();
<?php
class _╯°□°╯︵┻━┻ extends \Exception {}
function _╯°□°╯︵┻━┻($message) {
throw new _╯°□°╯︵┻━┻($message);
}
_╯°□°╯︵┻━┻("Flip Table");

Keybase proof

I hereby claim:

  • I am alexbowers on github.
  • I am bowersbros (https://keybase.io/bowersbros) on keybase.
  • I have a public key ASARDpx0lu-Nf4_c-gHI1CR3pzVPs6h4AEdydnJpuiqcWAo

To claim this, I am signing this object:

@alexbowers
alexbowers / handlers.yml
Created December 29, 2017 15:27
Install MySQL 5.7 via Ansible
---
- name: restart apparmor
become: yes
service:
name: apparmor
state: restarted
- name: restart mysql
become: yes
service: