Skip to content

Instantly share code, notes, and snippets.

@chriha
chriha / AppServiceProvider.php
Created December 16, 2020 12:40 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@chriha
chriha / createcertfilesfrompfx.sh
Created August 19, 2020 15:17 — forked from refo/createcertfilesfrompfx.sh
Create nginx cert files (pem, key) from pfx
#!/bin/bash
# Source:
# https://gist.github.com/ericharth/8334664
#
# Thanks:
# https://github.com/anderssonjohan
#
# Usage:
# ./createcertfilesfrompfx.sh /path/to/domain.pfx
#
@chriha
chriha / gist:f530fd0aa325015d71b51a17eff4c751
Created April 6, 2017 08:13 — forked from johnantoni/gist:07df65898456ace4307d5bb6cbdc7f51
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@chriha
chriha / .vimrc
Last active April 11, 2017 08:34 — forked from JeffreyWay/.vimrc
My .vimrc file (JeffreyWay fork)
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@chriha
chriha / MailTestCase.php
Created June 10, 2016 13:19 — forked from laracasts/MailTestCase.php
Use Mailcatcher to test email.
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
from MySQLdb import connect
conn = connect(user="[USER]", passwd= "[PASSWORD]")
cur = conn.cursor()
cur.execute("show databases;")
dbs_to_update = filter(
lambda db: db not in ('information_schema', 'mysql', 'performance_schema'),
[dbname[0] for dbname in cur.fetchall()])