Minor optimizing of a Laravel workflow using UNIX, Bash, and Python.

  • Open the terminal
  • Start Mysql.
  • Cd into my project folder
  • Open the project in Atom
  • Run php artisan serve
  • Open the localhost url in my browser
cd /usr/local/bin && touch work.sh
sudo nano work.sh
#! /bin/bashecho “hey”
sudo chmod +x work.sh
work.sh
cd
ls -la
sudo vim .zshrc
alias work=’work.sh’
source ~/.zshrc
work
mkdir .work && cd .work
touch main.py
sudo chmod +x main.py
import os
import webbrowser
# Path to the folder that contains your apps
path = str(“/Users/kasper/Sites/”)
projectFolders = list(os.listdir(path)
# Loop through folders
i = 0
while i < len(projectFolders):
# Prints folder name and index
print projectFolders[i] + “[“,i , “]”
i += 1
# User choice
choice = raw_input(‘Which project will you work on?’)
  • Starting MySQL
  • Opens the site in the browser.
  • Navigate to our selected folder
  • Run php artisan serve
# Start mysql
os.system(“mysql.server start”)
# Open Browser
webbrowser.open(‘http://127.0.0.1:8000')
# Opens Atom
os.system(“atom “ + path + projectFolders[int(choice)])
# Navigate to folder, run php artisan serve
os.system( “cd “ + path + projectFolders[int(choice)] + “ && php artisan serve” )
vim /usr/local/bin/work.sh
#! /bin/bashpython /Users/username/.work/main.py

--

--

--

Hello, Nice to meet you! https://kasperkloster.dk/en

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CS371P Spring 2021: Uma Sethuraman — Final Entry

Best Plagiarism Detectors For Professionals In 2022

Developer Journey Started with the Crio.Do #CWOD

Python Dependency Injection with flask-injector

How Much Does It Cost to Develop an Education App in 2021 like Byju’s

Installing a MySQL NDB Cluster 8.0 on Rocky Linux 8

Parsing HTTP Params in Python Heroku Starter App

Building a multi-user platform for real-time, very large graph editing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kasper Kloster

Kasper Kloster

Hello, Nice to meet you! https://kasperkloster.dk/en

More from Medium

Setup a LEMP Stack on Ubuntu 22.04

Which is the best for Web development between Python with Django and PHP with Laravel

Deploying Laravel to Heroku via Git (CD)

How to manage and use Nginx Virtual host in Ubuntu