Skip to content

Instantly share code, notes, and snippets.

View jartes's full-sized avatar
🦖

Joan Artés jartes

🦖
View GitHub Profile
@jartes
jartes / .gitconfig
Created April 13, 2018 08:54
Gitconfig
[user]
name = Your Name
email = your@email.com
[core]
autocrlf = input
[color]
ui = true
@jartes
jartes / app.js
Created March 8, 2018 11:13
JS debugging
jQuery(document).ready(function($){
var debug = true;
if ( debug ) console.log('Init');
});
@jartes
jartes / social-share.php
Last active August 29, 2015 14:14
Social Share Buttons
<?php
function PROJECT_NAME_social_buttons() {
$social = '
<ul class="PROJECT_NAME-social">
<li class="facebook">
<a href="http://www.facebook.com/sharer.php?u=' . urlencode( get_permalink() ) . '" target="_blank">Facebook</a><span class="count">' . PROJECT_NAME_get_facebook_count( get_permalink() ) . '</span>
</li>
<li class="twitter">
@jartes
jartes / comment-callback.php
Created November 4, 2014 09:47
Comment Callback For WordPress
<?php
/**
* Callback to render custom comment markup
*/
function project_name_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
// Proceed with normal comments.
global $post;
?>
<script>
(function(doc) {
var viewport = document.getElementById('viewport');
if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) {
viewport.setAttribute("content", "initial-scale=0.3");
} else if ( navigator.userAgent.match(/iPad/i) ) {
viewport.setAttribute("content", "initial-scale=0.7");
}
}(document));
</script>
@jartes
jartes / nginx.conf
Last active August 29, 2015 14:06 — forked from markjaquith/nginx.conf
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@jartes
jartes / wpml-has-category.php
Last active March 6, 2019 08:16
WordPress WPML has_category()
<?php
function has_wpml_category( $category_slug = null ) {
// bye bye no slug provided
if ( is_null( $category_slug ) )
return false;
// Default languange don't need to be checked
global $sitepress;
@jartes
jartes / twentyfourteen_ms.php
Created June 19, 2014 17:52
Twenty Fourteen Multisite Activation and Sign up
<?php
/**
* Adds boddy class on Multisite Activation and Sign Up pages.
*
*/
function twentyfourteen_multisite_classes() {
add_filter( 'body_class', 'twentyfourteen_add_multisite_classes' );
}
add_action( 'activate_header', 'twentyfourteen_multisite_classes' );
@jartes
jartes / _s.css
Last active August 29, 2015 14:02
_s CSS Cleanup
/*
Theme Name: Theme Name
Theme URI: http://underscores.me/
Author: Author
Author URI:
Description:
Version: 1.0
Text Domain: theme-name
Domain Path: /languages/
@jartes
jartes / wp-config.php
Created June 17, 2014 09:43
WordPress wp-config.php Development
<?php
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('SAVEQUERIES', true);
?>