Skip to content

Instantly share code, notes, and snippets.

View mikebronner's full-sized avatar
🖥️
Scrum of the earth.

Mike Bronner mikebronner

🖥️
Scrum of the earth.
View GitHub Profile
@mikebronner
mikebronner / optimize-ssl.sh
Last active January 27, 2016 10:17
Enable SSL Session Cache, add optimized SSL Cypher suite, enable SSL stapling. Run as `root` when using as recipe, or use `sudo` if performing it manually.
cat > /etc/nginx/conf.d/ssl_optimizations.conf <<EOT
# Session Cache Settings
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 180m;
# SSL Cyphers
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
# Enable SSL Stapling
ssl_stapling on;
$palette = imagecreatefrompng(public_path() . "/assets/palette.png");
$metalsPalette = imagecreatefrompng(public_path() . "/assets/metalsPalette.png");
$colorsPalette = imagecreatefrompng(public_path() . "/assets/colorsPalette.png");
$basesPalette = imagecreatefrompng(public_path() . "/assets/basesPalette.png");
$original1 = imagecreatefrompng(public_path() . '/uploads/test1.png');
$original2 = imagecreatefrompng(public_path() . '/uploads/test2.png');
$resampled1 = imagecreatetruecolor(5, 5);
$resampled2 = imagecreatetruecolor(5, 5);
$adjusted1 = imagecreatetruecolor(5, 5);
$adjusted2 = imagecreatetruecolor(5, 5);
@mikebronner
mikebronner / 2016_09_26_190624_add_stripe_fields_and_table.php
Last active September 29, 2016 16:40
MIgrate Laravel Cashier from 5.x to 6.x/7.x (Be sure to test before running on production!)
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStripeFieldsAndTable extends Migration
{
/**
* Run the migrations.
@mikebronner
mikebronner / init.coffee
Last active October 26, 2018 19:51
Mike Bronner's Atom Packages
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mikebronner
mikebronner / MyController.php
Last active December 15, 2016 23:42
Prevent Server Timeouts using HTTP Status Code 102
<?php namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class MyController extends Controller
{
public function store(Request $request) : JsonResponse
{
@mikebronner
mikebronner / after.sh
Created December 7, 2017 21:55
Homestead Database Backups via cron
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
sudo rm /etc/cron.daily/database-backup
sudo bash -c "cat > /etc/cron.daily/database-backup" <<EOL
#!/bin/bash
sites:
# what was before
- map: purpleturtles.dev
to: /home/vagrant/Sites/purpleturles.com/public
# now becomes
- map: purpleturtles.dev.example.com
to: /home/vagrant/Sites/purpleturles.com/public