Skip to content

Instantly share code, notes, and snippets.

View laravel-ide-helper.md

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 Aug 19, 2022
PHP Access a private property of an object
View php-access-private-property-object.php
<?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 Aug 18, 2022
Test the compatibility of source code with a given version of PHP
View test-syntax-php-version-support.md

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
Created Jun 20, 2022
HEIC is the new format for IOS photos
View Convert HEIC to JPG
mogrify -format jpg *.HEIC
@mikedamoiseau
mikedamoiseau / gist:c26a089d6cb2e489d5d942a7d5ab2e29
Last active Jan 22, 2022
mount NTFS partition with write permission on OSX Monterey (12.0)
View gist:c26a089d6cb2e489d5d942a7d5ab2e29
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 Jun 17, 2021 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
View .gitconfig
#
# 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)"
View facetime-ubuntu.md
@mikedamoiseau
mikedamoiseau / gist:1d05957077b3c72ab7fd5ac06330e8a5
Created Sep 26, 2020
Format drive partition to exFAT on Ubuntu
View gist:1d05957077b3c72ab7fd5ac06330e8a5
Need to install these tools:
`sudo apt install exfat-utils exfat-fuse`
Use software `Disks`
@mikedamoiseau
mikedamoiseau / ftp-download-upload.md
Created Sep 16, 2020
FTP: Download and upload through command line
View ftp-download-upload.md

Download

wget -m --user="user@login" --password="Pa$$wo|^D" ftp://server.com/

Upload

  1. Download NcFTP
  2. ~/ncftp-3.2.6/bin/ncftpput -R -v -u "USERNAME" HOST REMOTE_FOLDER LOCAL_FOLDER
@mikedamoiseau
mikedamoiseau / d8-backup-db.sh
Created Aug 28, 2020
Drupal - Backup DB using Drush
View d8-backup-db.sh
#!/bin/bash
# staging or production
DB_ENV="staging"
##### DO NOT EDIT FROM HERE #####
# Find the container
CONTAINER="$(docker ps | grep c-${DB_ENV} | awk '{print $1}')"