Skip to content

Instantly share code, notes, and snippets.

View juanfra's full-sized avatar
🍕

Juan Aldasoro juanfra

🍕
View GitHub Profile
@juanfra
juanfra / 0_reuse_code.js
Created June 12, 2014 19:22
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
@juanfra
juanfra / css_resources.md
Created June 12, 2014 19:23 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@juanfra
juanfra / javascript_resources.md
Created June 12, 2014 19:23 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@juanfra
juanfra / flatbase-exclude-category.php
Last active September 30, 2015 13:40
Exclude category on flatbase knowledge base grid.
<?php
//* Do NOT include the opening php tag
// filter the knowledgebase parser
function nice_knowledgebase_exclude_cat( $args ){
$args['exclude'] = '8'; // replace 8 with the id of the category you want to exclude
return $args;
}
@juanfra
juanfra / nice-general.js
Created June 25, 2015 14:51
Paeon JS file without the fade in/out effect for the slider caption.
/* global script variables */
var $parallex_effect = true;
var window_width = 0;
jQuery(document).ready( function($) {
/* Handles functionality that depends on window resize */
var innerWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
window_width = Math.max( jQuery( window ).width(), innerWidth );
jQuery( window ).resize(function() {
@juanfra
juanfra / load-custom-js.php
Created January 21, 2016 13:32
Load custom JS file.
<?php
//* Do NOT include the opening php tag
add_action( 'wp_head', 'nice_load_custom_js', 10 );
function nice_load_custom_js() {
if ( file_exists( get_stylesheet_directory() . '/custom.js' ) ) {
wp_register_script( 'nice-custom-scripts-js', get_stylesheet_directory_uri() . '/custom.js', array( 'jquery' ) );
wp_enqueue_script ( 'nice-custom-scripts-js' );
@juanfra
juanfra / editor-style-color.php
Created February 27, 2016 14:43
Add the editor style font and color.
<?php
//* Do NOT include the opening php tag
if ( ! function_exists( 'nice_add_editor_custom_styles' ) ) :
add_action( 'after_wp_tiny_mce', 'nice_add_editor_custom_styles' );
/**
* Make sure custom styles are correctly applied to TinyMCE editor.
*
* We use jQuery to wait for the document to be ready, and then we rely on a
* little timeout to ensure TinyMCE is completely loaded before applying styles
@juanfra
juanfra / smart-top-bar-social-icon.php
Last active July 4, 2017 21:21
Add the `[social_icon]` shortcode functionality for the top bar. Usage would be something like: [social_icon url="http://facebook.com/nicethemes" icon="fa-facebook"]
<?php
//* Do NOT include the opening php tag
if ( ! function_exists( 'nice_top_bar_social_icon_shortcodes' ) ) :
add_filter( 'nice_top_bar_shortcodes', 'nice_top_bar_social_icon_shortcodes' );
/**
* Add shortcodes to top bar.
*
* @since 1.0.2
*
@juanfra
juanfra / smart-top-bar-social-icons.php
Created July 4, 2017 21:27
Add [social_icons] to include all icons on the top bar
<?php
//* Do NOT include the opening php tag
if ( ! function_exists( 'nice_top_bar_social_shortcode' ) ) :
add_filter( 'nice_top_bar_shortcodes', 'nice_top_bar_social_shortcode' );
/**
* Add shortcodes to top bar.
*
* @since 1.0.2
*
@juanfra
juanfra / tec-excerpt-length.php
Created April 16, 2018 21:17
Modify the number of words on the event excerpt
<?php
//* Do NOT include the opening php tag
/**
* Modify the number of words on the event excerpt
*
*/
add_filter( 'excerpt_length', 'tec_custom_excerpt_length' );
function tec_custom_excerpt_length( $words ) {