Skip to content

Instantly share code, notes, and snippets.

Juan Rangel JuanRangel

View GitHub Profile
@JuanRangel
JuanRangel / php.ini
Created Aug 21, 2018
PHPStorm php.ini xdebug config settings
View php.ini
[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 Nov 21, 2017
A simple stub for testing against stripes api for a subscription.
View SubscriptionTest.php
$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 Jan 30, 2017
Laravel - Format Dates
View Model.php
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 Jan 30, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Aug 10, 2016
Add social fields to user profile
View customer-user.php
add_filter( 'user_contactmethods', 'vsellis_contactmethods' );
function vsellis_contactmethods( $contactmethods ) {
$contactmethods = [
'twitter' => 'Twitter',
'instagram' => 'Instagram',
'pinterest' => 'Pinterest',
'linkedin' => 'Linkedin',
'facebook' => 'Facebook',
];
View Simple Widget Boilerplate
<?php
class Widget_Name extends WP_Widget
{
protected $widget_slug = 'widget-slug';
public function __construct()
{
parent::__construct(
View Genesis Add Action
function $FUNCTION$() {
$END$
}
add_action( 'genesis_$ACTION$', '$FUNCTION$' );
View genesis-setup.php
// 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' );
View _themes.scss
$theme-blue: #779ECB;
$theme-purple: #CA98C9;
$theme-red: #FF6861;
$theme-green: #89E894;
$theme-dark: #78797B;
.theme-blue {
.site-header,
@JuanRangel
JuanRangel / style.scss
Created May 16, 2015
Main SCSS stylesheet
View style.scss
/*
Theme Name: THEME NAME
Theme URI: VSELLIS
Description: VSELLIS shoreline description.
Version: 1.0
Author: VSELLIS
Author URI: vsellis.com
Template: genesis
*/
You can’t perform that action at this time.