Skip to content

Instantly share code, notes, and snippets.

View rodrisan's full-sized avatar
🏠
Working from home

Rodrigo S rodrisan

🏠
Working from home
  • 18:46 (UTC -06:00)
View GitHub Profile
@rodrisan
rodrisan / yoast_seo_canonical_change_woocom_shop.php
Created January 24, 2020 19:43 — forked from amboutwe/yoast_seo_canonical_change_woocom_shop.php
Code snippets for the Yoast SEO canonical output
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
function yoast_seo_canonical_change_woocom_shop( $canonical ) {
if ( !is_shop() ) {
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@rodrisan
rodrisan / True Trello Printer
Created January 16, 2020 17:56 — forked from mathiasrw/True Trello Printer
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
@rodrisan
rodrisan / README.md
Created January 14, 2020 17:56 — forked from ralphschindler/README.md
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

@rodrisan
rodrisan / Dockerfile
Created November 29, 2019 15:19 — forked from avandrevitor/Dockerfile
Docker PHP 7.2 Apache
FROM php:7.2.10-apache
LABEL maintainer='André Vitor Cuba de Miranda <[email protected]'
# Update and Download Packages Debian
RUN apt-get update --yes
# Install Dependencies
RUN apt-get install --yes \
autoconf \
@rodrisan
rodrisan / yoast_seo_sitemap_add_custom_type.php
Created September 20, 2019 00:29 — forked from amboutwe/yoast_seo_sitemap_add_custom_type.php
Filters and example code for Yoast SEO sitemaps
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Create Custom Yoast Sitemap
* Credit: Unknown
* Last Tested: Unknown
*********
* HOW TO USE
* Replace TYPE with your custom type
*/
@rodrisan
rodrisan / UUID.php
Created September 6, 2019 17:05 — forked from dahnielson/UUID.php
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@rodrisan
rodrisan / .vimrc
Created May 20, 2019 17:34 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@rodrisan
rodrisan / .bash_profile
Created June 20, 2018 18:53 — forked from pablete/.bash_profile
Change iTerm2 profile (ie: background color) when SSHing into another machine
# Changing iTerm2 color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas)
# Adapted from https://gist.github.com/porras/5856906
# 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc.
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;))
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to
# "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with
# the SSH colors)
function tabc() {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change