Skip to content

Instantly share code, notes, and snippets.

View amochohan's full-sized avatar

Amo Chohan amochohan

View GitHub Profile
@GesJeremie
GesJeremie / EmailExampleTest.php
Created November 23, 2015 02:58
Email test case for testing emails with Mailtrap.io in Phpunit
<?php
/*
|--------------------------------------------------------------------------
| EmailExampleTest
|--------------------------------------------------------------------------
|
| Email test case for testing emails with Mailtrap.io in Phpunit
|
| Requirements:
| - Laravel 5.1
@josh7weaver
josh7weaver / mysqlBuilder.php
Last active April 22, 2023 07:28
insert on dup key update BULK
<?php namespace [YOUR NAMESPACE HERE];
use Illuminate\Database\Eloquent\Model;
use Log;
use DB;
class MysqlBuilder {
protected $table;
protected $pdoPlaceholderLimit;
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...