Skip to content

Instantly share code, notes, and snippets.

View JulianBonilla7's full-sized avatar

Julián Bonilla JulianBonilla7

  • 00:53 (UTC -05:00)
View GitHub Profile
@JulianBonilla7
JulianBonilla7 / slider-view.js
Created November 16, 2018 12:49
Check for slider value on initialize
var matchedSliderPoint = _.find(slider.points,function(e) {
return e.value === slider.value;
});
if(matchedSliderPoint === undefined) matchedSliderPoint = slider.points[0];
if(initialize) {
this.changeValue(slider, matchedSliderPoint);
} else {
this.changeValue(slider, slider.currentPoint);
}
@JulianBonilla7
JulianBonilla7 / _text.scss
Created June 13, 2018 20:46
Components repo change
// components/sass/themes/he-base/_text.scss
//Default styles for all text blocks
.items {
@include p1();
}
//Typography classes that are reused. To use these, drop them onto the text block as a class.
.p1 {
@include p1();
}
@JulianBonilla7
JulianBonilla7 / drawing.js
Created August 9, 2017 04:56
Drawing app in Panda.JS
game.module(
'game.objects'
)
.body(function() {
game.createClass('Canvas', {
drawings: [],
g: new game.Graphics(),
init: function(position, size, style) {
@JulianBonilla7
JulianBonilla7 / shortcode-metabox.php
Created October 11, 2016 16:11
Add a metabox with the shortcode for a specific slider
<?php
function slider_post_types_register() {
register_post_type( 'slider',
array(
'labels' => array(
'name' => __( 'Sliders' ),
'singular_name' => __( 'Slider' ),
'add_new' => __( 'Add New Slider' ),
'add_new_item' => __( 'Add New Slider' ),
<?php
/*
Plugin Name: Swapps Wordpress Slider
Plugin URI: http://swapps.io
Description: Easy, simple sliders.
Author: Julián Bonilla
Version: 0.1
Author URI: http://swapps.io/
*/
<?php
$args = array( 'post_type' => 'slider');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<h2><?php the_title(); ?></h2>
<?php
if( have_rows('slide') ): ?>
<div class="carousel fade-carousel slide" data-ride="carousel" data-interval="4000" id="bs-carousel">
<!-- Overlay -->