Skip to content

Instantly share code, notes, and snippets.

davidrushton / Kernel.php
Created Feb 17, 2016
Laravel 5 Database Queue - Shared Hosting
View Kernel.php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
thiagomarini /
Created Oct 29, 2018
How to install supervisor on Amazon Linux
# Install it as a yum package instead of throgh pip (will save you from lots of hassle)
# first get epel
sudo amazon-linux-extras install epel
# then install supervisor
sudo yum install supervisor
joecliff / cryptojs_base64_encrypt_decrypt.js
Last active Jul 12, 2021
An example of base64 usage in cryptojs
View cryptojs_base64_encrypt_decrypt.js
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
ARolek /
Last active May 14, 2021
Install ImageMagick from source on Amazon Linux

I needed a newer version of ImageMagick than is available on the yum packages on Amazon Linux. I tried using the remi repo but it failed with dependency errors. Here is what I did to install ImageMagick with support for PNG, JPG, and TIFF.

download the most recent package


uncomress the package

mauris / queue-ensure.php
Created Apr 28, 2014
Laravel Artisan Queue Ensurer - Set a cron job to run this file periodically to ensure that Laravel's queue is processing all the time. If the queue listener stopped, restart it!
View queue-ensure.php
function runCommand ()
$command = 'php artisan queue:listen > /dev/null & echo $!';
$number = exec($command);
file_put_contents(__DIR__ . '/', $number);
if (file_exists(__DIR__ . '/')) {
krambertech / Component.jsx
Created Jul 2, 2016
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
View Component.jsx
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
hirobert / response-content-disposition-cloudfront.txt
Last active Mar 2, 2021
response-content-disposition and cloudfront
View response-content-disposition-cloudfront.txt
1) Log in to aws console.
2) Click cloudfront
3) Click behaviors
4) Select pattern and edit
ibrahimlawal / paystack-transaction-initialize.php
Last active Dec 17, 2020
Initializing a Paystack Transaction for 20 naira // And verifying it. // Uses Paystack Class :
View paystack-transaction-initialize.php
// Get this from
require 'Paystack.php';
$paystack = new Paystack('sk_test_xxx');
// the code below throws an exception if there was a problem completing the request,
// else returns an object created from the json response
$trx = $paystack->transaction->initialize(
ibrahimlawal / PaystackFees.php
Last active Apr 6, 2020
A php class to add paystack's local charge to a transaction total. Totally flops if the user pays with a foreign card.
View PaystackFees.php
class PaystackFees
const DEFAULT_THRESHOLD = 250000;
const DEFAULT_CAP = 200000;
public static $default_percentage = PaystackFees::DEFAULT_PERCENTAGE;
ibrahimlawal /
Last active Nov 22, 2019
My PHP libraries Git hooks


  • php in your path
  • git
  • your php projects should have phpunit installed


  • download all files, rename them removing the .sh extension.
  • chmod +x each of them
  • copy git-mrm and git-ddev to a folder in your executable path e.g. /usr/local/bin