Skip to content

Instantly share code, notes, and snippets.

View tjventurini's full-sized avatar
💭
🚀

Thomas 𝕍enturini tjventurini

💭
🚀
View GitHub Profile
<?php
$finder = PhpCsFixer\Finder::create()
->exclude(['bootstrap', 'node_modules', 'public', 'storage', 'vendor'])
->notPath('*')
->in(__DIR__);
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(array(
@tjventurini
tjventurini / dc.zsh
Created October 1, 2020 16:36
Helper for docker-composer.
function dc() {
# check if there is a docker-compose.yml or docker-compose.yaml file in the current directory
if [ -f "./docker-compose.yml" ] || [ -f "./docker-compose.yaml" ]; then
print -P "%F{green}./docker-compose.yml%f"
( docker-compose $* )
return 0
fi
# check if there is a docker directory with a docker-compose.yml or docker-compose.yaml in it.
if [ -f "./docker/docker-compose.yml" ] || [ -f "./docker/docker-compose.yaml" ]; then
@tjventurini
tjventurini / 2019_06_20_193155_create_posts_tag_pivot_table.php
Last active June 20, 2019 19:42
Laravel Migration for Pivot Table
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostTagPivotTable extends Migration
{
/**
* Run the migrations.
@tjventurini
tjventurini / homestead.zsh
Created February 23, 2019 20:54
Homestead Oh-My-Zsh Plugin
# add homestead function to terminal
function homestead() {
( cd ~/Homestead && vagrant $* )
}
@tjventurini
tjventurini / php-method.sublime-snippet
Created February 20, 2019 08:44
Sublime Text Snippet for PHP Methods
<snippet>
<content><![CDATA[
${5}
${1:public }function ${2:name}(${3:params})${4:: void}
{
${6:// some code}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>method</tabTrigger>
@tjventurini
tjventurini / Default (Linux).sublime-keymap
Last active June 4, 2019 08:30
Commands for Sublime Vintage Mode. Requires Chain of Commands Package.
[
{
"keys": ["j", "j"],
"command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
@tjventurini
tjventurini / laravel_post_receive hook
Last active November 11, 2018 00:05 — forked from vool/laravel_post_receive hook
Post receive hook for Laravel website deploy
#!/bin/bash
echo "********************"
echo "Post receive hook: Updating website"
echo "********************"
#set the git repo dir
GIT_REPO_DIR=~/git/<repo>.git
echo "The git repo dir is $GIT_REPO_DIR"

Using Git to Manage a Live Web Site

Overview

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.

Contents

@tjventurini
tjventurini / de_countries.php
Last active November 16, 2021 11:59 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
/*
|--------------------------------------------------------------------------
| Country Codes
|--------------------------------------------------------------------------
|
| Array of available country codes to generate form fields and stuff like
| that.
|