Skip to content

Instantly share code, notes, and snippets.

@juancarloscruzd
juancarloscruzd / nginx.conf
Created February 26, 2017 19:37 — forked from jrom/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@juancarloscruzd
juancarloscruzd / API.md
Created October 6, 2016 16:18 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@juancarloscruzd
juancarloscruzd / git-aliases.md
Created October 5, 2016 01:05 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@juancarloscruzd
juancarloscruzd / nginx.conf
Created October 1, 2016 18:29 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
@juancarloscruzd
juancarloscruzd / Git push deployment in 7 easy steps.md
Created July 26, 2016 05:33 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
<style>
.inner-addon .glyphicon {
position: absolute;
padding: 10px;
pointer-events: none;
}
</style>
<div class="inner-addon right-addon">
<a href="#" style="display:block;"><i class="glyphicon glyphicon-search"></i></a>
@juancarloscruzd
juancarloscruzd / .gitignore
Created January 12, 2016 21:59 — forked from drblue/.gitignore
.gitignore for (local) Wordpress theme development
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# Originaly from http://ironco.de/bare-minimum-git/
# ver 20150130
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@juancarloscruzd
juancarloscruzd / gist:babce63d94716483a268
Created December 20, 2015 02:29
Remove unnecessary tags that Wordpress insert in header
<?php
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
remove_action( 'wp_head', 'adjacent_posts_rel_link' );
@juancarloscruzd
juancarloscruzd / remove_user_fields_woocommerce.php
Created December 19, 2015 21:52
Remove user fields Woocommerce
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed