Skip to content

Instantly share code, notes, and snippets.

UnaiYecora

Block or report user

Report or block UnaiYecora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@UnaiYecora
UnaiYecora / index.html
Last active Nov 13, 2019
Vue.js: Show object/array as comma-separated list on a v-for
View index.html
<!-- This is how you get a comma-separated list of items in Vue.js 2.0,
without a comma at the end of the last item -->
<p v-for="(item, index) in items">
{{author}}<span v-if="index != (items.length - 1)">,</span>
</p>
@UnaiYecora
UnaiYecora / temporary-email-address-domains
Last active May 21, 2016 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
View temporary-email-address-domains
*@0815.ru
*@0wnd.net
*@0wnd.org
*@10minutemail.co.za
*@10minutemail.com
*@123-m.com
*@1fsdfdsfsdf.tk
*@1pad.de
*@20minutemail.com
*@21cn.com
@UnaiYecora
UnaiYecora / functions.php
Last active Oct 6, 2015
Add category name to body_class
View functions.php
add_filter('body_class','add_category_to_single');
function add_category_to_single($classes) {
if (!is_admin() && is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->taxonomy . '-' . $category->slug;
}
}
// return the $classes array
View materialDesignShadowHelper.less
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage:
View nameofyoursite-functionality-plugin-2.php
<?php
/*
Plugin Name: Functionality plugin for [Name of your site]
Plugin URI: http://unaiyecora.com/writings/how-to-make-a-functionality-plugin-instead-of-using-functions-php/
Description: Move most of your functions outside of functions.php
Author: Unai Yécora
Version: 1.0
Author URI: http://www.unaiyecora.com/
License: GPL2
*/
@UnaiYecora
UnaiYecora / functions.php
Last active Aug 29, 2015 — forked from jeherve/functions.php
[Jetpack] Customize the contents of the "Older Posts" text appearing when activating Infinite Scroll.
View functions.php
<?php
function jeherve_custom_infinite_more() {
if ( is_home() || is_archive() || is_search() ) {
?>
<script type="text/javascript">
//<![CDATA[
infiniteScroll.settings.text = "Custom Text";
//]]>
</script>
You can’t perform that action at this time.