Skip to content

Instantly share code, notes, and snippets.

@JuanRangel
JuanRangel / Model.php
Created January 30, 2017 20:00
Laravel - Format Dates
protected $dates = [‘field_that_uses_date’];
// Allows the use of carbon. i.e $post->date->format(‘m d Y’);
@JuanRangel
JuanRangel / SubscriptionTest.php
Created November 21, 2017 00:22
A simple stub for testing against stripes api for a subscription.
$user = factory(User::class)->create(['stripe_id' => false]);
$plan = factory(Plan::class)->create(['name' => 'freelancer']);
$token = \Stripe\Token::create([
"card" => [
"number" => "4242424242424242",
"exp_month" => 1,
"exp_year" => date('Y') + 1,
"cvc" => "123"
]
@JuanRangel
JuanRangel / php.ini
Created August 21, 2018 23:00
PHPStorm php.ini xdebug config settings
[xdebug]
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_port=9001
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
@JuanRangel
JuanRangel / .js
Last active December 8, 2022 01:30
StudenSearch
function studentSearch() {
const searchBar = `
<label for="search" class="student-search">
<span>Search by name</span>
<input id="search" placeholder="Search by name...">
<button type="button"><img src="img/icn-search.svg" alt="Search icon"></button>
</label>
`;
studentSearchBar.insertAdjacentHTML('beforeend', searchBar);