Skip to content

Instantly share code, notes, and snippets.

View pedrorvidal's full-sized avatar

Pedro Vidal pedrorvidal

  • Porto Alegre, Brazil.
View GitHub Profile
@pedrorvidal
pedrorvidal / work-with-multiple-github-accounts.md
Created February 14, 2024 15:50 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@braginteractive
braginteractive / gulpfile.js
Created August 13, 2018 19:41
Gulp 4 and WordPress Development
// Load all the modules from package.json
var gulp = require( 'gulp' ),
plumber = require( 'gulp-plumber' ),
autoprefixer = require('gulp-autoprefixer'),
watch = require( 'gulp-watch' ),
jshint = require( 'gulp-jshint' ),
stylish = require( 'jshint-stylish' ),
uglify = require( 'gulp-uglify' ),
rename = require( 'gulp-rename' ),
notify = require( 'gulp-notify' ),
@pedrorvidal
pedrorvidal / site.local.conf
Last active August 1, 2020 13:30
Virtual Hosts Ubuntu + Apache2
# sudo vim /etc/apache2/sites-available/exemplo.local.com.conf
<VirtualHost *:80>
ServerName exemplo.local.com
DocumentRoot /var/www/html/exemplo
<Directory /var/www/html/exemplo>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@esamattis
esamattis / .gitignore
Created September 7, 2016 10:42 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@RafaelFunchal
RafaelFunchal / .htaccess
Created July 28, 2015 20:12
Exclude the files ajax, upload and WP CRON scripts from authentication
# Exclude the files ajax, upload and WP CRON scripts from authentication
<FilesMatch "(admin-ajax\.php|media-upload\.php|async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Order allow,deny
Allow from all
Satisfy any
</FilesMatch>
@ryansechrest
ryansechrest / php-style-guide.md
Last active May 5, 2024 18:00
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@danielbachhuber
danielbachhuber / gist:7126249
Last active December 21, 2021 15:46
Include posts from authors in the search results where either their display name or user login matches the query string
<?php
/**
* Include posts from authors in the search results where
* either their display name or user login matches the query string
*
* @author danielbachhuber
*/
add_filter( 'posts_search', 'db_filter_authors_search' );
function db_filter_authors_search( $posts_search ) {
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 2, 2024 18:45
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@djalmaaraujo
djalmaaraujo / brazil-cities-states-en.json
Last active January 8, 2024 22:42
Cidades e estados brasileiros JSON & Javascript Object exported / Brazilian States and Cities in JSON or JS/Javascript
{
"states": [
{
"uf": "AC",
"name": "Acre",
"cities": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@dgmike
dgmike / wordpres-br.sh
Created June 18, 2012 17:59
Pega a ultima versao do WordPress pt-Br e descompacta
#!/bin/bash
# requires lynx,grep,awk,uniq,sort,egrep,head,xargs,wget,tar adn rm
lynx -dump http://br.wordpress.org/releases | /bin/grep "\.tar\.gz$" | awk -F'http://' '{ print "http://"$2 }' | uniq | sort -r | /bin/egrep -v 'RC|beta' | head -n1 | xargs wget -O wordpress-br.tar.gz
tar -xvf wordpress-br.tar.gz
/bin/rm wordpress-br.tar.gz