Skip to content

Instantly share code, notes, and snippets.

@cloudwales
cloudwales / AppServiceProvider.php
Last active October 7, 2024 12:05
Laravel DigitalOcean Migration DB fix
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Database\Events\MigrationsStarted;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\URL;
@cloudwales
cloudwales / October-home.html
Last active August 25, 2020 15:07
Create a Bootstrap 4 Page Layout for October CMS - Part 3
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Our Acme. Company</h1>
<p class="lead">Some dummy content to show what we have...</p>
</div>
</div>
(function(){var x={};x.Machine=function(){function l(l){this.context=l;this._stateTransitions={};this._stateTransitionsAny={};this._currentState=this._initialState=this._defaultTransition=null}l.prototype.addTransition=function(l,t,g,f){g||(g=t);return this._stateTransitions[[l,t]]=[g,f]};l.prototype.addTransitions=function(l,t,g,f){var r;g||(g=t);var y=[];var z=0;for(r=l.length;z<r;z++){var c=l[z];y.push(this.addTransition(c,t,g,f))}return y};l.prototype.addTransitionAny=function(l,t,g){t||(t=l);
return this._stateTransitionsAny[l]=[t,g]};l.prototype.setDefaultTransition=function(l,t){return this._defaultTransition=[l,t]};l.prototype.getTransition=function(l,t){if(this._stateTransitions[[l,t]])return this._stateTransitions[[l,t]];if(this._stateTransitionsAny[t])return this._stateTransitionsAny[t];if(this._defaultTransition)return this._defaultTransition;throw Error("Transition is undefined: ("+l+", "+t+")");};l.prototype.getCurrentState=function(){return this._currentState};l.prototype.setInitialState=
funct
@cloudwales
cloudwales / database.php
Last active March 5, 2017 12:52
Updated Config Vars DB Settings
<?php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', getenv("DB_HOST")),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', getenv("DB_DATABASE")),
'username' => env('DB_USERNAME', getenv("DB_USERNAME")),
'password' => env('DB_PASSWORD', getenv("DB_PASSWORD")),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
@cloudwales
cloudwales / database.php
Created March 1, 2017 16:22
Full database.php File
<?php
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
$host = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$database = substr($url["path"], 1);
return [
@cloudwales
cloudwales / database.php
Created March 1, 2017 16:16
Top of Database.php
<?php
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
$host = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$database = substr($url["path"], 1);
?>
@cloudwales
cloudwales / database.php
Created March 1, 2017 16:14
Database.php
<?php
'mysql' => array(
'driver' => 'mysql',
'host' => $host,
'database' => $database,
'username' => $username,
'password' => $password,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
@cloudwales
cloudwales / Procfile
Created March 1, 2017 16:12
Procfile PHP/Apache2
web: vendor/bin/heroku-php-apache2 public
@cloudwales
cloudwales / composer.json
Last active March 1, 2017 16:18
composer.json
"require": {
"laravel/framework": "5.3.*",
"indatus/dispatcher": "1.4.*",
"ext-mbstring": "*"
},
@cloudwales
cloudwales / .htaccess
Created August 8, 2016 20:29
Cross-Origin Resource Sharing policy
# ----------------------------------------------------------------------
# CORS-enabled images (@crossorigin)
# ----------------------------------------------------------------------
# Send CORS headers if browsers request them; enabled by default for images.
# developer.mozilla.org/en/CORS_Enabled_Image
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>