Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@daraul
daraul / decodeHtmlspecialChars.js
Last active February 11, 2024 01:18
Decode PHP's htmlspecialchars encoding with Javascript
return function(text) {
var map = {
'&': '&',
'&': "&",
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#039;': "'",
'&#8217;': "’",
'&#8216;': "‘",
@daraul
daraul / MigrateBatch.php
Created February 21, 2018 20:17
Laravel migrate:batch command
<?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;
### 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:
var exceptions = {
"are": "were",
"eat": "ate",
"go": "went",
"have": "had",
"inherit": "inherited",
"is": "was",
"run": "ran",
"sit": "sat",
"visit": "visited",
@daraul
daraul / gitattributes
Created April 23, 2015 03:04
This ignores wordpress config files on merge.
# Use our wp-config
wp-config.php merge=ours
// 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 //