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 / config
Created February 12, 2020 20:41
SSH Config - Sample file to show staff the common options to add to your '~/.ssh/config' file. This is just a text file and should have the same perms as the other files in ~/.ssh, usually 600 (read and write by user only).
#### Example SSH config file
# Host = a list of domains, IPs and personalized aliases that use this config
# entry. These alias names follow "Host" and are space delimited.
# e.g. Host 192.168.1.1 example.com example1 myalias1
# Hostname = the IP or real hostname
# e.g. Hostname 192.168.1.1
# User = the username
# e.g. User jdoe
# Port = if this is a non standard port, i.e. not 22

[Workspace name] Slack - Code of Conduct

TL;DR

  • Don't be a troll
  • Be respectful of others
  • Do not harass others
  • Do not share personal information of others to people outside the community
  • All content must be "safe for work"
@leogopal
leogopal / save-heroku-config-vars-to-env.sh
Created March 25, 2019 08:15
Script the setting of Heroku Variables
heroku config | sed 's/: */=/g; /^=/d' >> .env

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.

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 September 14, 2018 08:49
Using Multiple Git Repositories

Option 1: Multiple Remotes Pushed (And Fetched) Independently

$ cd myproject
$ git remote add bitbucket ssh://[email protected]/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 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.

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 February 14, 2018 08:16 — forked from hofmannsven/README.md
Storing WordPress files and database with WP-CLI on the server.