Skip to content

Instantly share code, notes, and snippets.

@mikedamoiseau
mikedamoiseau / update-drupal-composer.md
Created December 13, 2022 03:55
Updating Drupal core via Composer

See "Updating Drupal core via Composer" on Drupal's website.

# List available Drupal updates
composer outdated "drupal/*"

# Verify we are using "drupal/core-recommended"`
composer show drupal/core-recommended

# Update the core with its dependencies
@mikedamoiseau
mikedamoiseau / install-docker-ubuntu-20.04.md
Created September 13, 2022 03:51
Install Docker on Ubuntu 20.04
@mikedamoiseau
mikedamoiseau / laravel-ide-helper.md
Last active August 19, 2022 03:11
Laravel IDE Helper

Composer

"ide-helper": [
  "@php artisan ide-helper:models -N",
  "@php artisan ide-helper:generate",
  "@php artisan ide-helper:eloquent",
  "@php artisan ide-helper:meta",
]
@mikedamoiseau
mikedamoiseau / php-access-private-property-object.php
Last active August 19, 2022 04:15
PHP Access a private property of an object
<?php
/**
* In this example, we're binding the `$this` value of the closure to the object.
*/
class Foo {
private $secret = 'foo';
}
@mikedamoiseau
mikedamoiseau / test-syntax-php-version-support.md
Last active September 13, 2022 04:53
Test the compatibility of source code with a given version of PHP

Execute in the terminal:

docker run --rm -ti -v ./html:/app php:8.0 bash

Then:

find /app -name '*.php' | xargs -n1 /usr/local/bin/php -l > /app/reportphp8
@mikedamoiseau
mikedamoiseau / Convert HEIC to JPG
Last active January 23, 2023 08:38
HEIC is the new format for IOS photos
Install ImageMagick on OSX:
brew update && brew install imagemagick
Then run the command line:
mogrify -format jpg *.HEIC
@mikedamoiseau
mikedamoiseau / gist:c26a089d6cb2e489d5d942a7d5ab2e29
Last active January 22, 2022 09:28
mount NTFS partition with write permission on OSX Monterey (12.0)
Diskutil list
sudo mkdir /Volumes/disk2s1
sudo mount -t ntfs -o rw,auto,nobrowse /dev/disk2s1 /Volumes/disk2s1
Diskutil list will return something similar to this:
```
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
@mikedamoiseau
mikedamoiseau / .gitconfig
Created June 17, 2021 03:21 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@mikedamoiseau
mikedamoiseau / gist:1d05957077b3c72ab7fd5ac06330e8a5
Created September 26, 2020 07:47
Format drive partition to exFAT on Ubuntu
Need to install these tools:
`sudo apt install exfat-utils exfat-fuse`
Use software `Disks`