Skip to content

Instantly share code, notes, and snippets.

@chinleung
chinleung / install-laravel-nova-in-subfolder.md
Last active June 22, 2023 19:41
Installing Laravel Nova in subfolder

Instsalling Laravel Nova in a subfolder

This is a guide that will show you how to install Laravel Nova in a subfolder of a domain.

Clone the repository

Clone the repository in the home directory of the cPanel user.

cd /home/user
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active March 6, 2024 11:28
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
@taylorotwell
taylorotwell / weather.sh
Last active August 27, 2019 13:40
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 26, 2024 09:34
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@andrewlkho
andrewlkho / README.md
Last active March 30, 2023 01:22
Implementing HTTPS on NFSN (nearlyfreespeech.net) hosting using Let's Encrypt

These instructions are for implementing HTTPS on a NFSN-hosted static site using a certificate from Let's Encrypt. The certificate is generated manually on a separate computer.

Start off by installing the letsencrypt client. This requires sudo privileges and will install a bunch of packages:

% curl -O https://dl.eff.org/certbot-auto
% chmod +x ./certbot-auto
% ./certbot-auto

Generate the certificate. This will require you to publish some challenge responses on NFSN. I find it easiest to use tmux with letsencrypt running in one window and an SSH session to NFSN in another:

@bigdawggi
bigdawggi / wp-cli-active-themes-across-network
Last active February 16, 2023 05:54
WP-CLI commands to get the active themes across a WordPress blog network (single site ID with multiple blogs for the site)
# Be sure to change or omit the --network parameter; it defaults to 1.
wp site list --network=4 --field=url | while read line; do wp theme list --status=active --field=name --url=$line >> /tmp/wpcli-themes.txt; done && sort /tmp/wpcli-themes.txt | uniq -c
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active May 8, 2024 05:28
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@don1138
don1138 / font-stacks.css
Last active May 14, 2024 13:16
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
@alexcican
alexcican / Preferences.sublime-settings
Last active March 7, 2024 05:37
SublimeText User settings
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Color Scheme - Default/Tomorrow-Night-Eighties.tmTheme",
"file_exclude_patterns":
[
".DS_Store"
],
"folder_exclude_patterns":
[
"bin",