Skip to content

Instantly share code, notes, and snippets.

View LukeTowers's full-sized avatar
❄️
Building a snowman

Luke Towers LukeTowers

❄️
Building a snowman
View GitHub Profile
@LukeTowers
LukeTowers / ViewExampleSheet.php
Created June 16, 2023 14:18
Winter CMS Excel fromView
<?php
namespace LukeTowers\Excel\Exports\Sheets;
use Illuminate\Contracts\View\View as ViewContract;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithTitle;
use Maatwebsite\Excel\Events\AfterSheet;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
@LukeTowers
LukeTowers / README.md
Created May 11, 2023 00:16
Rasterize PDF as a Automator Quick Action

About

This is a Mac OS Automator Quick Action to rasterize selected PDFs should you ever be faced with having to print, sign, and scan a physical document.

Requirements:

  1. ImageMagick needs to be installed, you can install via brew install imagemagick in the terminal.
  2. \System\Library\CoreServices\Finder.app needs to be added under System Preferences -> Privacy & Security -> Full Disk Access.

Installation:

@LukeTowers
LukeTowers / BullshitDetector.js
Last active May 11, 2022 16:18
Random Bookmarklets I've accumulated
javascript:(function()%7Bvar d%3Ddocument,s%3Dd.createElement(%27script%27)%3Bs.crossOrigin%3D%27anonymous%27%3Bs.src%3D%27https://unpkg.com/%40mourner/bullshit%401.2.0/bullshit.js%27%3Bd.body.appendChild(s)%3B%7D())
@LukeTowers
LukeTowers / backup.php
Last active January 31, 2021 05:46
Homestead Helpers
<?php
$user = 'homestead';
$pass = 'secret';
$backupDir = '/vagrant/.backup';
$dbToSkip = ["information_schema", "mysql", "performance_schema", "sys"];
$driver = new mysqli_driver();
$driver->report_mode = MYSQLI_REPORT_ALL & MYSQLI_REPORT_STRICT;
$conn = new mysqli('127.0.0.1', $user, $pass);
$result = $conn->query("show databases");
find src/ -type f -print0 | xargs -0 sha256sum | sha256sum
@LukeTowers
LukeTowers / CODE_OF_CONDUCT.md
Created March 31, 2019 14:22
Personal Code of Conduct

Code of Conduct

This is not a community project. This is my project. I know that will disappoint some people, but I do this for fun in my own spare time. If it stops being fun, I will stop working on it, which will pretty much kill the project. There are millions of projects in the world and the only reason they continue (if they actually do) is because the maintainers stubbornly stick at it.

With that in mind, here is the code of conduct: If it is fun for me then it is good. If it is not fun for me, then it is not good.

Things I find fun include: Bug reports that explain what you saw and what you expected to see. Suggestions for features that would make your life better. Stories of how the software so far has already made your life better. Entertaining stories of how you used the software (bonus points if it includes pictures of cats). Offers to volunteer to improve something (super bonus points if you actually improve it). Questions about how the software works. Offers to write documentation (super, ex

@LukeTowers
LukeTowers / oc-tag-plugin-repo.sh
Created January 28, 2019 07:17 — forked from petehalverson/oc-tag-plugin-repo.sh
October CMS plugin repo tag script
#!/bin/bash
# Tag your October CMS plugin's repo with versions.
# Run from plugin working directory
if [ ! -d .git ]; then
echo "Not a git repo" && exit 1;
elif [ ! -f updates/version.yaml ]; then
echo "Plugin version.yaml not found" && exit 1;
fi
@LukeTowers
LukeTowers / ChristmasGift.php
Last active December 27, 2018 16:38
christmas:gift console command
<?php namespace System\Console;
use Illuminate\Console\Command;
/**
* Console command to tear down the database.
*/
class ChristmasGift extends Command
{
/**
@LukeTowers
LukeTowers / Inline Styles.css
Last active November 16, 2018 17:16
Clean Gmail's crap new design
div[role="main"] > div:not(:last-child):not([class=""])[class] {
height: 2.25em;
}
div[aria-label="Side panel"] > div > div[role="tablist"] {
display: none;
}
div.no > div:last-child {
display: none;
@LukeTowers
LukeTowers / cloudSettings
Created October 30, 2018 16:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-30T16:23:36.424Z","extensionVersion":"v3.2.0"}