Skip to content

Instantly share code, notes, and snippets.

@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 / _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 / 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 / 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 / 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 / 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>