Skip to content

Instantly share code, notes, and snippets.

View plcosta's full-sized avatar

Pedro Costa plcosta

  • Brazil
  • 23:22 (UTC -03:00)
View GitHub Profile
@SmashBrando
SmashBrando / flex-bs-pricing.php
Last active November 12, 2019 04:18
Bootstrap Price Table | Advanced Custom Fields | Flexible Content | Repeater | Comma Separated Features
<?php
// check if the flexible content field has rows of data
if( have_rows('flexible_content') ):
// loop through the rows of data
while ( have_rows('flexible_content') ) : the_row();
//check current row layout
if( get_row_layout() == 'pricing' ):
#!/usr/bin/make
include .env
export
.PHONY: help
.DEFAULT_GOAL := help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@oeN
oeN / weighted.rb
Last active April 29, 2020 19:34
Shuffle a Weighted array in Ruby
def weighted
a = []
(1..60).each do |i|
a << { value: "HIGH_#{i}", weight: 5 }
end
(1..30).each do |i|
a << { value: "MID_#{i}", weight: 3 }
end
(1..15).each do |i|
a << { value: "LOW_#{i}", weight: 2 }
@jpweber
jpweber / config.fish
Last active May 22, 2020 22:48
config.fish
# Load fishmarks (http://github.com/techwizrd/fishmarks)
. $HOME/.fishmarks/marks.fish
fish_vi_key_bindings
alias rmi "rm -i"
alias ark "docker run --rm -u (id -u) -v ~/.kube/config:/kubeconfig -e KUBECONFIG=/kubeconfig gcr.io/heptio-images/ark:latest"
alias oc "code ."
# kubernets aliases
alias kget "kubectl get"
@amboutwe
amboutwe / yoast_seo_meta_remove_dates.php
Last active October 5, 2020 08:39
Remove Date Meta Tags Output by Yoast SEO
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
* For Yoast SEO 14.0 or newer, please see https://yoast.com/help/date-appears-search-results/#h-managing-dates
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // Premium versions 5.2 or older
@daldegam
daldegam / commands-unix-macos.md
Last active February 12, 2021 14:20
Comandos Unix (MAC OS)

Unix Commands

Command Sample Description
pipe - Liga a saida de um comando na entrada de outro
&& cmd && cmd Executa um comando logo após o outro
cat cat Duplica o conteúdo digitado (ctrl+d = sair)
cat cat file.txt Lê um arquivo (ctrl+d = sair)
cat cat > file.txt Cria um arquivo com o conteúdo digitado (ctrl+d = sair)
@DanielMarklund
DanielMarklund / gist:3415529
Created August 21, 2012 13:39
Laravel - Navigation Active Class
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@protosam
protosam / Minikube for Mac Users.md
Last active March 8, 2022 22:50
Notes for switching from Docker Desktop to Minikube

With Docker Desktop becoming more restricted, I've decided to move on to just using minikube. In doing so, I've consolidated my notes as follows.

Installation

Use brew to install the docker cli and minikube.

$ brew install minikube docker kubectl hyperkit

Running Minikube

The first time you start minikube, you should specify any settings you desire.