Skip to content

Instantly share code, notes, and snippets.

@Gimcrack
Gimcrack / disable_first_option.html
Created July 15, 2016 18:30
Disable First Option In Select List
<select>
<option selected disabled>Choose</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
@Gimcrack
Gimcrack / TestCase.php
Created August 24, 2017 16:47
Improved Laravel TestCase
<?php
namespace Tests;
use App\User;
use Exception;
use TestHelper;
use App\Exceptions\Handler;
use PHPUnit\Framework\Assert;
use Illuminate\Support\Collection;
@Gimcrack
Gimcrack / json_sanitize.js
Created November 10, 2017 01:24
Sanitize Json String
/**
* Given you have a JSON string that represents a single object (not array).
* SanitizeJsonString will attempt to correct the JSON syntax allowing
* it to be parsed.
*/
/**
* Sanitize user input before attempting to parse the JSON
*
@Gimcrack
Gimcrack / Api.js
Created November 10, 2017 08:21
Api.js
export default {
prefix : 'api/v1/',
get(url, data) {
return axios.get( this.prefix + url, data )
},
post(url, data) {
return axios.post( this.prefix + url, data )
@Gimcrack
Gimcrack / _ide_macros.php
Created December 19, 2017 18:21
IDE Macro Helper for Laravel
<?php
namespace {
exit("This file is only for ide indexing");
}
namespace Illuminate\Support {
use Tests\TestCase;
@Gimcrack
Gimcrack / rpm_reset.sh
Created January 26, 2018 21:44
NPM Reset
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
@Gimcrack
Gimcrack / package.json
Created May 6, 2019 19:52
Laravel echo server for development
{
"scripts" : {
"echo-dev" : "laravel-echo-server --config=laravel-echo-server-dev.json start"
}
}
@Gimcrack
Gimcrack / wiki-100k.txt
Created October 12, 2019 19:48 — forked from h3xx/wiki-100k.txt
Wictionary top 100,000 most frequently-used English words [for john the ripper]
the
of
and
to
a
in
that
I
was
he
@Gimcrack
Gimcrack / TrelloScrumStyle.css
Created January 12, 2020 05:11
TrelloScrumStyle.css
/*========================================================
= Scrum for your Trello board =
==========================================================
@author: Vinícius Stutz
@site: http://www.vinicius-stutz.com/
@date: 7 jan 2016
*/
@Gimcrack
Gimcrack / PapertrailFormatter.php
Created August 25, 2020 23:32
Papertrail Log Formatter
<?php
namespace App\Exceptions;
use Monolog\Formatter\LineFormatter;
class PapertrailFormatter extends LineFormatter {
public const SIMPLE_FORMAT = "%channel%.%level_name%: %message% %context% %extra%\n";