Skip to content

Instantly share code, notes, and snippets.

🌸
Trying to build a better web.

Leo Gopal leogopal

🌸
Trying to build a better web.
Block or report user

Report or block leogopal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leogopal
leogopal / save-heroku-config-vars-to-env.sh
Created Mar 25, 2019
Script the setting of Heroku Variables
View save-heroku-config-vars-to-env.sh
heroku config | sed 's/: */=/g; /^=/d' >> .env
View LaravelSeedIgnoreExistingDataSeeder.md

Problem

I have some data that I have in a config file or array that I need to make sure all of that data is in laravel. This is how I accomplish it using firstOfCreate(). In my problem I had a config file with arrays of roles, data types, and permissions, and the latter needed to be merged but it should not create it if it already exists.

View nvm_default.md

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

@leogopal
leogopal / multiple-git-repos.md
Created Sep 14, 2018
Using Multiple Git Repositories
View multiple-git-repos.md

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”:

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

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.

View antispambot.md

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 / README.md
Created Feb 14, 2018 — forked from hofmannsven/README.md
Storing WordPress files and database with WP-CLI on the server.
View README.md
@leogopal
leogopal / .gitignore
Created Jan 30, 2018
A WordPress specific .gitignore
View .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
View db-install.sh
#/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
You can’t perform that action at this time.