Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / install-docker-ubuntu-20.04.md
Created September 13, 2022 03:51
Install Docker on Ubuntu 20.04
@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 / backup-db.sh
Last active November 27, 2022 07:23
Script to backup a MySQL database and send the dump by email and/or scp
#!/bin/bash
# ----------------------------------
# DEFINED - Global variables
# ----------------------------------
# defined temporary folder
DBBACKUP="dbbackup"
# database configure
@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 / 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