Skip to content

Instantly share code, notes, and snippets.

View Tjoosten's full-sized avatar
🌏
Somewhere between home and Hogwarts School of Witchcraft and Wizardry

Tim Joosten Tjoosten

🌏
Somewhere between home and Hogwarts School of Witchcraft and Wizardry
  • Polar Youth
  • Antwerp, BE
  • 13:48 (UTC +02:00)
  • X @x0rif
View GitHub Profile
@czottmann
czottmann / gist:3402842
Created August 20, 2012 10:11
Bug report template
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
@DanielMarklund
DanielMarklund / gist:3415529
Created August 21, 2012 13:39
Laravel - Navigation Active Class
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
@gitaarik
gitaarik / git_submodules.md
Last active April 22, 2024 10:52
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.

Quick install PHP 7.0:

1. Install depends PHP 7.0
$ brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
2. Configure PHP 7.0
$ git clone --depth=1 https://github.com/php/php-src.git

$ cd php-src

@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active April 22, 2024 17:19
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@bradp
bradp / gist:8b379e71daa4b6a61d14
Last active August 14, 2023 08:40
Useful SQL Queries
#Get the size of each table, ordered by largest to smallest
SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "YOU+TABLE+NAME+HERE"
ORDER BY (data_length + index_length) DESC;
#Get the size of the entire DB
SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
@m4grio
m4grio / Blueprint.php
Last active June 14, 2019 06:45
Extending Laravel 5 Blueprint for MySqlConnection
<?php
namespace App\Database\Schema;
use Illuminate\Database\Schema\Blueprint as ParentBlueprint;
use Illuminate\Support\Facades\DB;
/**
* Class Blueprint
*
@jacurtis
jacurtis / App\Exceptions\Handler.php
Created July 28, 2016 02:31
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
@jasonmccreary
jasonmccreary / fixup.sh
Last active September 19, 2019 14:37
Shell function to "fixup" and "autosquash" a commit with a single command.
# ref: https://twitter.com/gonedark/status/1174460639005356032
# usage: fixup [ref]
function fixup() {
git commit --fixup="$1"
GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash "$1"~1
}
# credit: https://stackoverflow.com/questions/29094595/git-interactive-rebase-without-opening-the-editor