Skip to content

Instantly share code, notes, and snippets.

@drbyte
drbyte / class.limitCartValue.php
Created May 13, 2014 19:23
Limit cart contents to max $1million (for ZC v1.3.9h)
<?php
/**
* This file should be uploaded as: /includes/classes/observers/class.limitCartValue.php
* It also requires that the config.limitCartValue.php file also be installed. See below.
* Limit shopping cart total value, to mitigate against DDOS attacks
*/
class limitCartValue extends base {
/** constructor method
* Attach listeneners to events
@drbyte
drbyte / Convert line-endings to DOS-style
Created May 6, 2015 18:06
Convert line-endings to DOS-style
perl -pe ’s/\r\n|\n|\r/\r\n/g’ source.txt > dest.txt
@drbyte
drbyte / .bash_aliases.sh
Last active August 29, 2015 14:27 — forked from michaelsbradleyjr/.bash_aliases.sh
Some helpful docker aliases
# GNU parallel
# better than xargs: http://www.gnu.org/software/parallel/
# install: (wget -O - pi.dk/3 || curl pi.dk/3/) | bash && \
# echo will cite | parallel --bibtex
command -v parallel &>/dev/null
if [ $? != 0 ]; then
alias para='xargs'
else
alias para='parallel'
fi
@drbyte
drbyte / laravel-behat-setup.sh
Created August 17, 2015 01:01
Laravel Behat "Prep" script
#!/bin/bash
Echo 'Adding the HTML/Form helper'
composer require Illuminate/Html
echo 'Adding IDE Helper for PHPStorm/SublimeText'
composer require barryvdh/laravel-ide-helper --dev
php artisan ide-helper:generate
php artisan ide-helper:meta
@drbyte
drbyte / bash_profile.md
Last active September 8, 2015 02:06 — forked from irazasyed/bash_profile.md
Terminal: Mac OS X Terminal Aliases & How-To - .bash_profile / .profile

Mac OS X Terminal Aliases & How-To

Collection of some of my fav terminal aliases that i use often & collected from the web. This file will be updated with more aliases as i find more. Feel free to comment and share your fav aliases you use :)

###Follow these simple steps to add the following aliases:###


  1. Within the Terminal, run:
@drbyte
drbyte / SnsBroadcaster.php
Last active September 11, 2015 18:14 — forked from jeskew/SnsBroadcaster.php
Laravel broadcasting with SNS
<?php
use Aws\Sns\SnsClient;
use Illuminate\Contracts\Broadcasting\Broadcaster;
class SnsBroadcaster implements Broadcaster
{
/** @var SnsClient */
private $sns;
/** @var array */
@drbyte
drbyte / Are you Ready to Hire an Engineer?.md
Created November 20, 2015 15:44 — forked from craychee/Are you Ready to Hire an Engineer?.md
A plain English checklist to help non-technical people decide if the business is ready to engage the services of an engineer or a consulting firm. This checklist was made to accompany the following blog post: http://craychee.io/blog/2015/09/17/are-you-ready-to-hire-an-engineer/

Are you Ready to Hire an Engineer?

A plain English checklist


This checklist is intended to help non-technical people decide if the business is ready to engage the services of an engineer or a consulting firm. It is the goal of this checklist to give non-technical folks a leg up in these conversations so that they are less likely to get into lengthy (and very expensive) engagements.


###Content Content pertains to information that you already provide customers or plan to make available to anyone who comes to your site.

@drbyte
drbyte / pr.md
Created March 14, 2016 04:58 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

<?php
namespace App\Http\Middleware;
use Closure;
class RoleMiddleware
{
/**
* Handle an incoming request.
@drbyte
drbyte / ApiRespond.php
Created November 15, 2016 16:08 — forked from dugajean/ApiRespond.php
Trait for easy creation of API responses
<?php
namespace App\Traits;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
trait ApiRespond
{
/**