Skip to content

Instantly share code, notes, and snippets.

View jesseschutt's full-sized avatar
🌲
Working from home

Jesse Schutt jesseschutt

🌲
Working from home
View GitHub Profile
@jesseschutt
jesseschutt / Disable xdebug for CircleCI
Created January 11, 2021 17:37
Disable xdebug for CircleCI
- run:
name: Disable xdebug
command: |
sudo sed -i 's/^zend_extension/;zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
@jesseschutt
jesseschutt / RenameForeignKeyColumn.php
Created July 14, 2020 14:28
Renaming a column that is a foreign key in Laravel
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ConvertCustomerIdToUserIdOnSubscriptionsTable extends Migration
{
/**
* Run the migrations.
export SENTRY_BEARER_TOKEN="MyBearerToken"
export SENTRY_PROJECT="my-sentry-project-name"
export ENVIRONMENT="develop"
export PREVIOUS_SHA=`tail {{release}}/.commit_hash_previous`
cd {{ release }}
curl https://sentry.io/api/0/organizations/zaengle/releases/ \
-H "Authorization: Bearer ${SENTRY_BEARER_TOKEN}" \
-X POST \
-H "Content-Type:application/json" \
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Process\Process;
class MQTT extends Command
{
protected $signature = 'mqtt:kill-process';
cd /home/forge/your-site.com
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.3-fpm reload
yarn install
yarn production
# This value is set at the top of the subscriber.js
@jesseschutt
jesseschutt / subscriber.js
Created February 16, 2020 00:44
A simple node script to subscribe to an MQTT broker and forward on messages to a Laravel application.
process.title = 'mqtt-demo-process-node'
const mqtt = require('mqtt')
const axios = require('axios')
const debug = process.env.NODE_ENV !== 'production'
let endpoint = 'https://####.test/messages'
if(process.env.NODE_ENV === 'production') {
endpoint = 'https://####.com/messages'
@jesseschutt
jesseschutt / example
Created April 8, 2019 13:56
2019-04-08
date('Y-m-d');
Carbon::now()->format('Y-m-d');
@jesseschutt
jesseschutt / example
Last active April 7, 2019 23:58
11/4/80 - 11:45:23 am
date('n/j/y - h:i:s a');
Carbon::now()->format('n/j/y - h:i:s a');
@jesseschutt
jesseschutt / example
Last active April 7, 2019 23:58
11:45:23 AM
date('h:i:s A');
Carbon::now()->format('h:i:s A');
@jesseschutt
jesseschutt / example
Last active April 7, 2019 23:58
11:45 am
date('h:i a');
Carbon::now()->format('h:i a');