Skip to content

Instantly share code, notes, and snippets.

View RichardStyles's full-sized avatar

Richard Styles RichardStyles

View GitHub Profile
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@BenSampo
BenSampo / deploy.sh
Last active April 20, 2024 23:54
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@calebporzio
calebporzio / PreviewOfUpcomingPackage.php
Last active April 16, 2024 06:26
A model trait that allows child models to use parent table names and relationship keys.
<?php
namespace App\Abilities;
use Illuminate\Support\Str;
use ReflectionClass;
/**
* Note: This is a preview of an upcoming package from Tighten.
**/
@Nikita240
Nikita240 / subtrees.sh
Created June 7, 2017 08:12
Convert git submodules to git subtrees
#!/bin/bash -x
# This script will convert all your git submodules into git subtrees.
# This script ensures that your new subtrees point to the same commits as the
# old submodules did, unlike most other scripts that do this.
# THIS SCRIPT MUST BE PLACED OUTSIDE OF YOUR REPOSITORY!!!!!!!!!!
# Otherwise, the script will interfere with the git commits (unless you add it to .gitignore).
# Save the script in your home directory as `~/subtrees.sh`
# `cd` into your repository
# Run `~/subtrees.sh`
# Enjoy!
@shikhirsingh
shikhirsingh / package.json
Created September 11, 2016 20:56
A template package.json for packaging an Ext JS app with Electron for macOS ONLY
{
"name": "starterapp",
"version": "1.0.0",
"description": "A starter Ext JS 6 App",
"main": "./app/main.js",
"scripts": {
"start": "electron .",
"package": "electron-packager ./ starterapp --platform=darwin --out ./dist --overwrite",
"test": "echo \"Error: no test specified\" && exit 1"
},
@shikhirsingh
shikhirsingh / package.json
Created August 23, 2016 17:10
A template package.json for packaging an Ext JS app with Electron
{
"name": "starterapp",
"version": "1.0.0",
"description": "A starter Ext JS 6 App",
"main": "./app/main.js",
"scripts": {
"start": "electron .",
"package": "electron-packager ./ starterapp --all --out ./dist --overwrite",
"test": "echo \"Error: no test specified\" && exit 1"
},
@laracasts
laracasts / Gulpfile.js
Created August 20, 2014 20:47
PHPSpec auto-testing Gulpfile
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.