- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
| <?php | |
| class PhpObf { | |
| private array $names = array(); | |
| private string $nono = "\x1b[H\x1b[2J\x1b[3J"; | |
| private string $enctype = ''; |
| #!/bin/bash | |
| # This file goes in .git/hooks/commit-msg | |
| set -e | |
| git_diff=$(cat "$1") | |
| prompt="I want you to help me write a commit message. When I send the output of git diff, I want you to send only a suggested git commit message (only the message, no commands, nothing else), and do not send any explanation or anything else with it. Here is the git diff:\n${git_diff}" | |
| (echo "$prompt") | openai complete - >> "$1" |
| #!/usr/bin/env python3 | |
| """Chat with GPT-3 from the Terminal.""" | |
| import os | |
| import openai | |
| if os.path.exists(os.path.expanduser("~/.openai")): | |
| openai.api_key = open(os.path.expanduser("~/.openai")).read().strip() | |
| else: | |
| print("Enter your OpenAI API key: ", end="") | |
| openai.api_key = input() |
| #!/bin/sh | |
| # Shell script to add docker-ce to Deepin Linux repositories | |
| # Remove old docker | |
| sudo apt-get remove -y docker docker-engine docker.io containerd runc | |
| # Install dependencies | |
| sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common | |
As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.