Skip to content

Instantly share code, notes, and snippets.

@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);
@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 / 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 / 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 / 0_reuse_code.js
Created January 30, 2017 19:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@JuanRangel
JuanRangel / customer-user.php
Created August 10, 2016 20:39
Add social fields to user profile
add_filter( 'user_contactmethods', 'vsellis_contactmethods' );
function vsellis_contactmethods( $contactmethods ) {
$contactmethods = [
'twitter' => 'Twitter',
'instagram' => 'Instagram',
'pinterest' => 'Pinterest',
'linkedin' => 'Linkedin',
'facebook' => 'Facebook',
];
<?php
class Widget_Name extends WP_Widget
{
protected $widget_slug = 'widget-slug';
public function __construct()
{
parent::__construct(
function $FUNCTION$() {
$END$
}
add_action( 'genesis_$ACTION$', '$FUNCTION$' );
@JuanRangel
JuanRangel / genesis-setup.php
Created May 16, 2015 03:36
Genesis setup file
// Priority 15 ensures it runs after Genesis itself has setup.
add_action( 'genesis_setup', 'theme_prefix_genesis_setup', 15 );
function theme_prefix_genesis_setup() {
//* Define Constants
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Shoreline' );
define( 'CHILD_THEME_URL', 'http://vsellis.com/themes/shoreline' );
@JuanRangel
JuanRangel / _themes.scss
Created May 16, 2015 03:27
Color Schemes
$theme-blue: #779ECB;
$theme-purple: #CA98C9;
$theme-red: #FF6861;
$theme-green: #89E894;
$theme-dark: #78797B;
.theme-blue {
.site-header,