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
  • 18:40 (UTC +02:00)
  • X @x0rif
View GitHub Profile
Petitions {#76 ▼
#table: "petitions"
#fillable: array:4 [▶]
#connection: null
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#perPage: 15
+exists: true
@Tjoosten
Tjoosten / lol
Created February 14, 2017 14:28
http://9gag.com/gag/a2rqMNO

MySQL guide - Activisme-BE

Overview

These guidelines are designed to be compatible with Joe Celko's SQL Programming Style book to make adoption for teams who already read that book easier. This guide is a little more opinionated in some areas and in others a little more relaxed. It is certainly more succint where Celko's book contains anecdotes and reasoning behind each rule thoughtful prose.

It is easy to include this guide in Markdown format as a part of a project's code base or reference it here for anyone on the project to freely read - much harder with a physical book.

@Tjoosten
Tjoosten / controller.php
Created January 22, 2017 17:23
ERROR: View is always returning the four first records of the db
/**
* Get the front-end for the nws items.
*
* @see GET|HEAD: http://www.domain.tld/news
* @return blade view.
*/
public function index()
{
// Needed data for the pagination.
$query = Articles::with(['comments', 'author', 'categories']);
DROP TABLE IF EXISTS `gov_members`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gov_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(255) DEFAULT NULL,
`Function` varchar(255) DEFAULT NULL,
`Union_id` int(11) DEFAULT NULL,
`Information` varchar(500) DEFAULT NULL,
`photo` varchar(255) DEFAULT NULL,
<?php
namespace ActivismBe\Controllers;
use Silex\Application;
use ActivismBe\Models\User;
use Silex\Api\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\Constraints as Assert;
<?php
namespace ActivismBe\Controllers;
use Silex\Application;
use Silex\Api\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use ActivismBe\Validators\LoginValidator;
class AuthController implements ControllerProviderInterface
<?php
use Chrisbjr\ApiGuard\Models\ApiKey;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
/**
* Class ApiRentalTest
*/
<?php
// Error: /disclaimer - Call to a member function render() on null
use Symfony\Component\HttpFoundation\Request;
$controller = $app['controllers_factory'];
/**
* GET|HEAD: https://domain.org/disclaimer.
@Tjoosten
Tjoosten / App\Exceptions\Handler.php
Created October 26, 2016 01:24 — forked from jacurtis/App\Exceptions\Handler.php
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;