Skip to content

Instantly share code, notes, and snippets.

View jrobinsonc's full-sized avatar
🎯
Focusing

Jose Robinson jrobinsonc

🎯
Focusing
View GitHub Profile
@jrobinsonc
jrobinsonc / Gruntfile.js
Created June 26, 2016 14:02
Grunt: change node_modules path.
module.exports = function(grunt) {
grunt.initConfig({
sass: {
build: {
files: {
'css/app.min.css': 'css/src/main.scss'
}
},
@jrobinsonc
jrobinsonc / menu.html
Last active July 3, 2016 00:11
Font Awesome social links
<ul class="menu">
<li class="twitter"><a href="#">Twitter</a></li>
<li class="facebook"><a href="#">Facebook</a></li>
<li class="pinterest"><a href="#">Pinterest</a></li>
<li class="google-plus"><a href="#">Google Plus</a></li>
</ul>
@jrobinsonc
jrobinsonc / FontAwesome.scss
Created July 3, 2016 00:10
SCSS FontAwesome mixin
@mixin FontAwesome($content: '') {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@if $content != '' {
&:before {
@jrobinsonc
jrobinsonc / loggly.php
Last active April 27, 2017 19:52
debugging tools
<?php
/**
* Using Loggly
* https://www.loggly.com/
*/
define('LOGGLY_ENDPOINT', 'http://logs-00.loggly.com/inputs/s59tg6b3-sd59-85de-d5d4-f5s96ty36caa');
function loggly_log($tag, $log)
{
@jrobinsonc
jrobinsonc / wp-clean.php
Created July 31, 2016 03:10
WordPress: wp-clean
<?php
#################################################
# Disable emojis
#################################################
/**
* Disable the emoji's
*/
function disable_emojis() {
@jrobinsonc
jrobinsonc / show_menu.php
Last active August 10, 2016 01:28
Wordpress helper: Show menu
<?php
/**
* show_menu
*
* @author JoseRobinson.com
* @link https://gist.github.com/jrobinsonc/932b7b7d3b724ac4be0399a81e1b3c08
* @version 1.0.0
* @param string $location
* @param array $args
@jrobinsonc
jrobinsonc / wpml.md
Last active May 20, 2020 19:21
WPML WordPress plugin
@jrobinsonc
jrobinsonc / wp-query.php
Last active June 13, 2019 17:54
Wordpress snippet: WP_Query with performance in mind
<?php
$query = new WP_Query([
'post_type' => 'post',
'posts_per_page' => 4,
'no_found_rows' => true, // useful when pagination is not needed
'update_post_meta_cache' => false, // useful when post meta will not be utilized
'update_post_term_cache' => false, // useful when taxonomy terms will not be utilized
'fields' => 'ids', // useful when only the post IDs are needed
]);
@jrobinsonc
jrobinsonc / cacheman.php
Last active October 14, 2020 23:31
Wordpress helper: cacheman
<?php
/**
* cacheman
*
* @author JoseRobinson.com
* @link https://gist.github.com/jrobinsonc/832f287b69fa3bfdd6f475fa33122edf
* @version 1.2.0
* @param string $key
* @param callable $callback
@jrobinsonc
jrobinsonc / enable-html.php
Last active May 11, 2021 18:00
WordPress: SMTP configuration
<?php
/**
* Set body as HTML.
*/
function set_html_content_type()
{
return 'text/html';
}