Skip to content

Instantly share code, notes, and snippets.

View leogopal's full-sized avatar
🌍
Working on a better, free-er web.

Leo Gopal leogopal

🌍
Working on a better, free-er web.
View GitHub Profile
@leogopal
leogopal / OSX Development Setup
Last active January 23, 2018 08:38
OSX Development Setup Script
#!/usr/bin/env bash
#
# Notes:
#
# - Homebrew & Git require Xcode Command Line Tools, OS X should prompt you on first install.
#
echo "Starting Mac OS X Dev Setup..."
# Check for Homebrew, install if we don't have it
@leogopal
leogopal / ApplicationsandTools.md
Last active February 18, 2022 15:01
List of often used Applications and Tools
  • Transmit File Transfer
  • Google Chrome
  • Firefox
  • Homebrew and Homebrew Cask
  • Vagrant
  • VirtualBox
  • Homestead for Laravel
  • Local by Flywheel (WordPress)
  • VVV (WordPress)
  • PHPStorm
@leogopal
leogopal / wp-cli-install-rec-plugins
Created January 29, 2018 04:52 — forked from MikeNGarrett/wp-cli-install-rec-plugins
Chained WordPress CLI commands to install and activate recommended plugins.
# wordpress-seo provides ability to edit meta information and provides sitemap.
# w3-total-cache provides advanced caching no matter the server technology available.
# better-wp-security provides brute force protection and a number of WordPress enhancements.
# google-analytics-for-wordpress provides robust Google Analytics integration through the Google API.
# redirection detects 404s and 301s and allows admins to set up redirects in the WP admin.
# ewww-image-optimizer provides automatic optimization of uploaded images with local libraries instead of cloud-based services.
# backupwordpress simple backup solution that can store backups above web root.
# relevanssi provides better site search using a local index.
# cloudflare is the best. Free automatic CDN and security solution.
# jarvis is a quick search for the WordPress admin. Indespensible.
#/bin/bash
cd _seed
FILENAME=$(find . -maxdepth 1 -name [a-zA-Z0-9]*-migrate-[0-9]*.sql.gz)
gunzip ${FILENAME} -c > temp.sql
read -p "New Domain Name e.g. http://example.com: " replacement
cat temp.sql | sed -e "s@##DEV_URL##@${replacement}@g" > temp2.sql
cat temp2.sql | sed -e "s@##DEV_PATH##@${replacement}@g" > new_db.sql
@leogopal
leogopal / .gitignore
Created January 30, 2018 06:42
A WordPress specific .gitignore
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore all files starting with .
.*
# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore
@leogopal
leogopal / README.md
Created February 14, 2018 08:16 — forked from hofmannsven/README.md
Storing WordPress files and database with WP-CLI on the server.

Note that you will not see the encoded email address in the inspector but it will display as encoded in the source code, view source will display it appropriately.

@leogopal
leogopal / multi-git.md
Created May 2, 2018 07:07 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

@leogopal
leogopal / multiple-git-repos.md
Created September 14, 2018 08:49
Using Multiple Git Repositories

Option 1: Multiple Remotes Pushed (And Fetched) Independently

$ cd myproject
$ git remote add bitbucket ssh://git@bitbucket.org/user/myproject.git
$ git push bitbucket master

Every time we commit any changes, we need to push to both our original “origin” and our new remote “bitbucket”:

Install the version that you would like

nvm install 6.1.0

Set 6.1.0 (or another version) as default

nvm alias default 6.1.0