Skip to content

Instantly share code, notes, and snippets.

View michaeldyrynda's full-sized avatar

Michael Dyrynda michaeldyrynda

View GitHub Profile

Keybase proof

I hereby claim:

  • I am michaeldyrynda on github.
  • I am michaeldyrynda (https://keybase.io/michaeldyrynda) on keybase.
  • I have a public key ASCSv4n5VGnpNDh0wt5Gx6P9LAbgdosHw1fuZ-YtwIoMKgo

To claim this, I am signing this object:

@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Created November 20, 2015 22:28
Clean old releases in Envoy
@task('clean_old_releases')
# This lists our releases by modification time and delete all but the 3 most recent.
purging=$(ls -dt {{ $release_dir }}/* | tail -n +3);
if [ "$purging" != "" ]; then
echo Purging old releases: $purging;
rm -rf $purging;
else
echo "No releases found for purging at this time";
fi
@michaeldyrynda
michaeldyrynda / array_clean.php
Created October 26, 2015 23:15
Helper function to clean empty array values from a one-dimensional array input
<?php
/**
* Ensure that the input array has no empty-string values assigned.
*
* @param array $array
*
* @return array
*/
function array_clean(array $array)
@michaeldyrynda
michaeldyrynda / blog.md
Last active August 29, 2015 14:27
No, you really can't

Mirrored from the Oracle Blog, as the original post appears to have been removed.

By User701213-Oracle on Aug 10, 2015

I have been doing a lot of writing recently. Some of my writing has been with my sister, with whom I write murder mysteries using the nom-de-plume Maddi Davidson. Recently, we’ve been working on short stories, developing a lot of fun new ideas for dispatching people (literarily speaking, though I think about practical applications occasionally when someone tailgates me).

Writing mysteries is a lot more fun than the other type of writing I’ve been doing. Recently, I have seen a large-ish uptick in customers reverse engineering our code to attempt to find security vulnerabilities in it. This is why I’ve been writing a lot of letters to customers that start with “hi, howzit, aloha” but end with “please comply with your license agreement and stop reverse engineering our code, already.”

I can underst

@michaeldyrynda
michaeldyrynda / gist:0967f384cb331f8c8f8a
Last active August 29, 2015 14:17
Simple command to add to your Homestead .bash_aliases file to create a new MySQL database
function newdb() {
if [[ "$1" ]]
then
mysql -uhomestead -p -e "CREATE DATABASE $1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci"
else
echo "Error: missing required parameter."
echo "Usage: "
echo " newdb dbname"
fi
}
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active March 25, 2016 02:43
Laravel 4 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com'])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active July 13, 2023 17:40
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@michaeldyrynda
michaeldyrynda / envswitch.sh
Last active August 29, 2015 14:14
Easily swap out environment config in Laravel 5
function envswitch() {
if [ ! "$1" ]
then
echo "Missing required parameter envname"
echo "File should exist in current directory as .env.envname"
echo "Usage:"
echo " envswitch envname"
return
fi
<?php
$rbls = [
'b.barracudacentral.org',
'cbl.abuseat.org',
'http.dnsbl.sorbs.net',
'misc.dnsbl.sorbs.net',
'socks.dnsbl.sorbs.net',
'web.dnsbl.sorbs.net',
'dnsbl-1.uceprotect.net',