Skip to content

Instantly share code, notes, and snippets.

View jesgs's full-sized avatar
🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
@Propaganistas
Propaganistas / MailHog configuration
Last active March 13, 2024 14:26
Laravel MailHog SMTP configuration
# Mailhog
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
@searbe
searbe / parse_xlsx.php
Created August 7, 2012 09:48
Parse simple XLSX in PHP with SimpleXML and ZipArchive
<?php
/**
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!)
* but the usual tools were hitting the memory limit pretty quick. I found that
* manually parsing the XML worked pretty well. Note that this, most likely,
* won't work if cells contain anything more than text or a number (so formulas,
* graphs, etc ..., I don't know what'd happen).
*/
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@westonruter
westonruter / 01-common-example.php
Last active November 9, 2023 05:22
Temporarily disabling filters in WordPress
<?php // Common way to do it:
remove_filter( 'the_title', 'wptexturize' );
$title = get_the_title();
add_filter( 'the_title', 'wptexturize' );
@milo
milo / github-webhook-handler.php
Last active July 26, 2023 15:29
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@geksilla
geksilla / bootsrap_class_list
Last active April 29, 2023 03:59
Bootstrap css class list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
@barryvdh
barryvdh / lumen_ide_helper.php
Last active April 10, 2023 10:26
Lumen IDE Helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
<?php
namespace EPH\DAEmbed;
function register_providers() {
$callback = __NAMESPACE__ . '\handle_deviantart';
wp_embed_register_handler( 'deviantart-main', '#https://www.deviantart.com/*+#', $callback, 10 );
// Include other handlers as needed
}
@matthewbdaly
matthewbdaly / phpcs.xml
Created September 23, 2017 12:53
Catch var_dump(), die() or dd() with PHP CodeSniffer, as well as enforcing PSR2 and various comment standards
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>Coding standard for a Laravel app.</description>
<file>app</file>
<file>tests</file>
<exclude-pattern>*/migrations/*</exclude-pattern>
@dieseltravis
dieseltravis / shrug.ahk
Last active January 3, 2023 15:58
autohotkey script to replace 🤷 with ¯\_(ツ)_/¯ (and a few other common unicode art emoji)
; :shrug: ¯\_(ツ)_/¯
:B0:`:shrug::
if (A_EndChar == ":") {
SendInput, {BS 7}¯\_(ツ)_/¯
}
return
; :whatever: ◔_◔
:B0:`:whatever::