Skip to content

Instantly share code, notes, and snippets.

View ttomdewit's full-sized avatar

Tom de Wit ttomdewit

View GitHub Profile
@Ocramius
Ocramius / handling-optional-input-fields-with-type-safe-abstractions.md
Last active March 17, 2023 12:06
Handling optional input parameters in PHP with `vimeo/psalm` and `azjezz/psl`

Handling optional input parameters in PHP with vimeo/psalm and azjezz/psl

I had an interesting use-case with a customer for which I provide consulting services: they needed multiple fields to be marked as "optional".

Example: updating a user

We will take a CRUD-ish example, for the sake of simplicity.

For example, in the following scenario, does a null $description mean "remove the description",

@thealanberman
thealanberman / mac_recommendations.md
Last active August 8, 2023 16:25
My Mac Recommendations

macOS Recommendations

General Utilities

  • Rectangle — a free option for window snapping/arrangement stuff.
  • AltTab — an improved window switcher with some decent customizability
  • Shifty — a macOS "night shift" slider
  • Raycast — Spotlight replacement, somewhat like Alfred, but free and more customizable
  • Better Touch Tool — not free, but worth every penny. Pretty awesome window snapping/arrangement capabilties (like Rectangle but MOAR), and lets you create shortcuts for keyboard/mouse/touchpad/touchbar/etc.
  • Keka — compression utility that handles 7zip, rar, and some other archive formats that don't work natively in macOS.
  • NameChanger — batch file-renamer with a handy intuitive UI
---
stages:
- testing
- qa
phpstan:
image:
name: hyperized/phpstan:latest
entrypoint: [""]
stage: testing
// The mixin
@mixin set-ratio($width, $height, $selectors...) {
// needed on the parent so the absolute childs reference it
position: relative;
// create our ratio with the psuedo before
&:before {
display: block;
content: "";
@roryashfordbentley
roryashfordbentley / General Rules
Last active October 28, 2015 15:22
Wordpress Security scripts for better protection. Add as needed to .htaccess
1. DO NOT use 'admin/administrator/website-name/company-name' as your WordPress username
2. DO generate a secure password
3. DO create your own themes so you can ensure they are clean
4. DO check plugin reviews and check they are actively maintained
5. DO Keep regular backups
6. DO NOT push `wp-config.php` to a public Git Repository
7. DO use a custom database prefix instead of the default `wp_`
8. DO use a custom Directory structure
9.