Skip to content

Instantly share code, notes, and snippets.

View fpigeonjr's full-sized avatar
🏠
Working from home

Frank Pigeon Jr. fpigeonjr

🏠
Working from home
View GitHub Profile
@fpigeonjr
fpigeonjr / start.php
Last active January 17, 2016 21:48
bootstrap/start.php
/*
|--------------------------------------------------------------------------
| Detect The Application Environment
|--------------------------------------------------------------------------
|
| Laravel takes a dead simple approach to your application environments
| so you can just specify a machine name for the host that matches a
| given environment, then we will automatically detect it for you.
|
*/
@fpigeonjr
fpigeonjr / gist:19cfd60ac2a9ee1ee26e
Created July 20, 2014 06:23
Team Collaboration using GitHub-BenB

Ben (Git Master)

  • composer create-project laravel/laravel [project domain]
  • ansible-playbook ansible/site-create.yml -e "domain=[project domain]" -l vagrant
  • subl /etc/hosts
  • Create Repo on GitHub
  • git init
  • git remote add origin [git url]
  • git push -u origin master
  • Grant Access to Teammates
@fpigeonjr
fpigeonjr / gist:1ebca053be4eee1c67ea
Created July 12, 2014 06:57
codeup site config

Database Setup (Once)

  • Update mysql script with user: codeup
  • Run mysql user create script (codeup): ansible-playbook ansible/mysql-user-db.yml -l digital_ocean -e "mysql_admin=true"
  • Connect to server via SequelPro.

New Site Setup (For each new site)

  • Update mysql script to add codeup user.
  • Run site create script: ansible-playbook ansible/site-create.yml -l digital_ocean -e "domain=myblog.com" --ask-sudo-pass
@fpigeonjr
fpigeonjr / upload.php
Last active January 17, 2016 21:50
attempt to upload csv
//move uploaded files to the upload directory
if (count($_FILES) > 0 && $_FILES['file1']['error'] == 0) {
if ($_FILES['file1']['type'] == 'text/csv'){
$upload_dir = '/vagrant/sites/codeup.dev/public/uploads/';
// Grab the filename from the uploaded file by using basename
$filename = basename($_FILES['file1']['name']);
// Create the saved filename using the file's original name and our upload directory
$saved_filename = $upload_dir . $filename;
// Move the file from the temp location to our uploads directory