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

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.

@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

[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 / 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
@leogopal
leogopal / .gitignore
Created February 12, 2020 22:32
WPEngine Recommended Git Ignores
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@leogopal
leogopal / .gitignore
Last active February 12, 2020 22:33
WPEngine Recommended .gitignore with WordPress
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@leogopal
leogopal / .gitignore
Created February 12, 2020 22:34
WPEngine Recommended .gitignore No WP.
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@leogopal
leogopal / reactions.rb
Created February 19, 2020 23:42 — forked from daybreaker/reactions.rb
Ruby script to check slack reaction counts
require 'slack-ruby-client' # first, make sure you do: gem install slack-ruby-client
require 'date'
# Add your Slack API token here
token = [YOUR TOKEN HERE]
Slack.configure do |config|
config.token = token
end
@leogopal
leogopal / .gitignore
Created February 22, 2020 07:36
Global .gitignore
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's `.gitignore` is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the `node_modules` directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file. Create a file called `.gitignore` in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.
#### Mac
git config --global core.excludesfile ~/.gitignore
#### Windows
git config --global core.excludesfile %USERPROFILE%\.gitignore