Skip to content

Instantly share code, notes, and snippets.

@edgrosvenor
edgrosvenor / dev.json
Last active July 4, 2020 14:18
Experimenting with wikimedia/composer-merge-plugin
{
"require": {
"grosv/eloquent-sheets": "dev-main",
"grosv/laravel-passwordless-login": "dev-main",
"wikimedia/composer-merge-plugin": "^1.4"
},
"require-dev": {
"grosv/laravel-git-workflow": "dev-main",
"grosv/stubby": "dev-main"
},
@calebporzio
calebporzio / caps_lock_to_command_escape.json
Last active November 24, 2022 19:54
A Karabiner-Elements complex modification rule
{
"title": "Caps Lock To Command/Escape",
"author": "Caleb Porzio(calebporzio.com)",
"homepage": "https://gist.github.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae",
"import_url": "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae/raw/08c397b09fbaa5ec90cf161e5bca97bdb43e8c55/caps_lock_to_command_escape.json",
"rules": [
{
"description": "Caps Lock to Command/Escape",
"manipulators": [
{
@calebporzio
calebporzio / RouteDirectives.php
Created January 4, 2020 10:33
Blade Route Directives
<?php
// Register these inside a service provider:
Blade::directive('route', function ($expression) {
return "<?php echo route({$expression}) ?>";
});
Blade::directive('routeIs', function ($expression) {
return "<?php if (request()->routeIs({$expression})) : ?>";
@calebporzio
calebporzio / HasUuid.php
Created July 5, 2018 17:36
A little trait to add to models that will have Uuids
<?php
// Example usage in a model:
class ExampleModel extends Model
{
use HasUuid;
protected $primaryKey = 'uuid';
{
"presets": [
["env", {
"targets": {
"node": "current"
}
}]
],
"plugins": [
["module-resolver", {
{
"env": {
"node": true,
"es6": true
},
"extends": "standard",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
@reinink
reinink / webpack.mix.js
Created November 20, 2017 13:19
Using Purgecss with Tailwind and Laravel Mix
let cssImport = require('postcss-import')
let cssNext = require('postcss-cssnext')
let glob = require('glob-all')
let mix = require('laravel-mix')
let purgeCss = require('purgecss-webpack-plugin')
let tailwind = require('tailwindcss')
mix.js('resources/assets/js/app.js', 'public/js')
.postCss('resources/assets/css/app.css', 'public/css/app.css', [
cssImport(),
@BretFisher
BretFisher / Dockerfile
Last active April 26, 2024 00:00
WIP sample Laravel php_fpm plus nginx plus supervisor Docker setup with npm, composer, bower, and more
FROM yourdockername/base-php-nginx:latest AS build
# BUILD STAGE
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# COPY IN BUILD SSH KEY
# It won't be copied to final image
# add this build arg to compose file
ARG BUILDKEY
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
@TheNodi
TheNodi / HashidsRoutable.php
Last active June 15, 2023 23:18
Laravel Model Bindings with Hashids
<?php
namespace App;
use Vinkla\Hashids\HashidsManager;
/**
* Bind a model to a route based on the hash of
* its id (or other specified key).
*
@NeuroWinter
NeuroWinter / ffmpeg cheatsheet for glitching
Last active April 13, 2024 09:09
ffmpeg cheatsheet for glitching
FFMPEG '-i', file, '-c:v', 'libopenjpeg', "jpeg2000\\" + name + ".jp2"\
Convert image to jpeg2000
ffmpeg -i in.png -c:v libopenjpeg out.jp2
Hex Edit out.jp2
ffmpeg -i in.jp2 -c:v png out.png
General Edit
ffmpeg -i input.avi -c:v mpeg2video -g 999 -q:v 1 output.avi
*edit in avidemux/whatever*