Skip to content

Instantly share code, notes, and snippets.

View bherrero's full-sized avatar
:octocat:

Borja Herrero bherrero

:octocat:
  • Gold Coast, Australia
  • 13:54 (UTC +10:00)
View GitHub Profile
{
"version": "0.9.7.2",
"cluster.messagebus.debug": false,
"cluster.messagebus.enabled": false,
"cluster.messagebus.sns.region": "",
"cluster.messagebus.sns.api_key": "",
"cluster.messagebus.sns.api_secret": "",
"cluster.messagebus.sns.topic_arn": "",
"dbcache.configuration_overloaded": false,
"dbcache.debug": "0",
{"version":1,"resource":"file:///Users/bherrero/Projects/AnnaRocias/src/pages/shows.njk","entries":[{"id":"S7XW.njk","timestamp":1653136431077},{"id":"rug4.njk","timestamp":1653137618952},{"id":"UK6m.njk","source":"moved.source","timestamp":1653138912418},{"id":"7k4l.njk","source":"moved.source","timestamp":1653175890600},{"id":"1KaV.njk","source":"moved.source","timestamp":1653181072481},{"id":"kz7G.njk","timestamp":1653181871469},{"id":"axsO.njk","timestamp":1653187848675},{"id":"0fpm.njk","timestamp":1653187901229},{"id":"prV4.njk","timestamp":1658537449427}]}
@bherrero
bherrero / app.html
Created December 19, 2019 06:58 — forked from freshcutdevelopment/app.html
Aurelia Gist - Creating a templated list
<template>
<require from="style.css"></require>
<require from="list-group"></require>
<require from="pokemon.html"></require>
<section>
<h1>${message}</h1>
<hr/>
<h3>custom template</h3>
@bherrero
bherrero / ssl.conf
Last active August 8, 2018 06:51
WordPress not loading CSS and JS when working behind NGINX SSL reverse proxy.
// If nginx
//etc/nginx/conf.d/ssl.conf
location /blog/ {
proxy_pass http://backend:8081/;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
@bherrero
bherrero / gist:e6e4cba4f1244ab64661a5c0a1f9e685
Created October 5, 2017 21:59 — forked from billerickson/gist:2047229
Improve performance of WP_Query
<?php
$args = array(
// Normal query goes here //
'no_found_rows' => true, // counts posts, remove if pagination required
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);
@bherrero
bherrero / functions.php
Last active August 8, 2018 06:52
Get all the posts for a CPT archive
// pre_get_posts to get all the posts por the CPT Archive
add_action( 'pre_get_posts', 'pre_get_posts_archive_custom_cpt' );
function pre_get_posts_archive_custom_cpt( $query ) {
if( is_admin() ) {
return;
}
if ( $query->is_post_type_archive( 'custom_cpt_name' ) && $query->is_main_query() ) {
$query->set( 'posts_per_page', -1 );
@bherrero
bherrero / functions.php
Created July 26, 2017 15:06 — forked from lmartins/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@bherrero
bherrero / SectionList.js
Created April 27, 2017 21:50
React Native - prepare SectionList's array with lodash
// maps it's an array of objects
// groupBy to extract section headers
let dataSource = _.groupBy(maps, o => o.name);
// reduce to generate new array
dataSource = _.reduce(dataSource, (acc, next, index) => {
acc.push({
key: index,
data: next
});
return acc;
@bherrero
bherrero / react-class-boilerplate.sublime-snippet
Last active April 14, 2017 01:08
React Class Snippet for writing components
<snippet>
<content><![CDATA[
import React from 'react';
class $1 extends React.Component {
render() {
return (
$2
);
}
@bherrero
bherrero / Contract Killer 3.md
Created January 23, 2017 17:15 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post