Skip to content

Instantly share code, notes, and snippets.

@kauhat
kauhat / .bashrc
Last active January 11, 2020 20:26
WP-CLI setup on Tsohost and Heart Internet shared servers
# Add ~/bin directory to path if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$PATH:$HOME/bin"
fi
# Set up alias for WP CLI
alias wp="php-7.2 $HOME/bin/wp-cli.phar"
@kauhat
kauhat / date_compare.sql
Created June 3, 2015 11:51
MySQL - Date compare with formatting
SELECT *, STR_TO_DATE(application.completed, '%m-%d-%y') AS `dateCompleted`
FROM `web244-newassess`.application
WHERE
completed
HAVING
(dateCompleted BETWEEN '2013-04-01' AND '2015-04-01')
ORDER BY dateCompleted;
@kauhat
kauhat / fancy-hr.css
Created June 10, 2015 14:36
Fancy style for horizontal rules
hr
{
position: relative;
height: 1px;
margin: 2em 0;
padding: 0;
clear: both;
text-align: center;
@kauhat
kauhat / find-error-logs.sh
Last active August 29, 2015 14:24
Find large "error_log" files
#!/bin/sh
workdirname="error-logs";
mkdir -p ${workdirname};
workdir=$(cd $workdirname; pwd);
echo "Finding all error_log files"
find /home -maxdepth 16 -name "error_log" -exec echo -n -e {}"\0" \; \
| du -hc --files0-from=- \
@kauhat
kauhat / .htaccess
Last active July 29, 2016 18:05
Compress & cache
# Add correct content types for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Enable keep-alive if we can
<IfModule mod_headers.c>
Header set Connection keep-alive
git submodule sync
git submodule update --init --recursive --remote

Keybase proof

I hereby claim:

  • I am kauhat on github.
  • I am kauhat (https://keybase.io/kauhat) on keybase.
  • I have a public key whose fingerprint is FB47 53D1 3E9B 0946 9BED ACCC AA1F 2C34 F36C 2863

To claim this, I am signing this object:

@kauhat
kauhat / docker-compose.override.yml
Created May 1, 2017 16:08
LaraDock node_modules & vendor volumes
version: '2'
services:
applications:
image: tianon/true
volumes:
- ${APPLICATION}:/var/www
- node_local:/var/www/node_modules
- composer_local:/var/www/vendor
@kauhat
kauhat / example.blade.php
Last active May 10, 2017 20:41
Laravel 5.4+ Bootstrap 3 panel component
@component('panel')
@slot('title')
Example
@endslot
{{-- Buttons and input inside 'panel-heading' --}}
@slot('actions')
<a class="btn btn-default" href="#">Create</a>
@endslot
@kauhat
kauhat / PaymentController.php
Last active August 14, 2017 14:21
Laravel Omnipay - Sagepay Example
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Cache;
use Omnipay;
use Omnipay\Common\CreditCard;