Skip to content

Instantly share code, notes, and snippets.

Daraul Harris daraul

Block or report user

Report or block daraul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c04d3235f94194ce4ad49e266c1a8d7d
### Keybase proof
I hereby claim:
* I am daraul on github.
* I am daraul (https://keybase.io/daraul) on keybase.
* I have a public key whose fingerprint is C13B 0EDE 410B 1C4D 859D AF83 477E D18B FF2A FCC7
To claim this, I am signing this object:
@daraul
daraul / MigrateBatch.php
Created Feb 21, 2018
Laravel migrate:batch command
View MigrateBatch.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
View past-tense.js
var exceptions = {
"are": "were",
"eat": "ate",
"go": "went",
"have": "had",
"inherit": "inherited",
"is": "was",
"run": "ran",
"sit": "sat",
"visit": "visited",
@daraul
daraul / decodeHtmlspecialChars.js
Last active Jul 18, 2019
Decode PHP's htmlspecialchars encoding with Javascript
View decodeHtmlspecialChars.js
return function(text) {
var map = {
'&amp;': '&',
'&#038;': "&",
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#039;': "'",
'&#8217;': "",
'&#8216;': "",
@daraul
daraul / gitattributes
Created Apr 23, 2015
This ignores wordpress config files on merge.
View gitattributes
# Use our wp-config
wp-config.php merge=ours
View wp-config
// The database URL to be parsed //
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
// The name of the database for WordPress //
define('DB_NAME', substr($url["path"], 1));
// MySQL database username //
define('DB_USER', $url["user"]);
// MySQL database password //
You can’t perform that action at this time.