This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -------------------------------------------------------------------- | |
| # Recursively find pdfs from the directory given as the first argument, | |
| # otherwise search the current directory. | |
| # Use exiftool and qpdf (both must be installed and locatable on $PATH) | |
| # to strip all top-level metadata from PDFs. | |
| # | |
| # Note - This only removes file-level metadata, not any metadata | |
| # in embedded images, etc. | |
| # | |
| # Code is provided as-is, I take no responsibility for its use, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # show the last entry in the git log for any file that ever existed in the repo (use -2 for the last 2 entries, and etc.) | |
| git log --full-history -1 -- <deleted/file> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $model->setRelation('foo', $foo); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Source: https://github.com/alexandra-default/cURL-proxy-video | |
| /** | |
| * Created by Alexandra.Default. | |
| * Date: 09.06.2018 | |
| * Time: 15:31 | |
| */ | |
| class VideoStream | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### | |
| # If you're getting this error in composer: | |
| # "PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted ..." | |
| # and changing php.ini doesn't help that's because composer has it's own | |
| # memory limit settings. To disable it on a single run, call composer this way: | |
| # | |
| COMPOSER_MEMORY_LIMIT=-1 composer require phpoffice/phpword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $im = new Imagick(); | |
| $im->setResolution(300, 300); //set the resolution | |
| $im->readImage('document.pdf[0]'); //[0] for the first page | |
| $im->setImageFormat('jpg'); | |
| $im->writeImage('preview.jpg'); | |
| // or to output it: | |
| // header('Content-Type: image/jpeg'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add file to use as a global .gitignore | |
| touch $HOME/.gitignore; | |
| # set it as a global excludefile in git | |
| git config --global core.excludesfile $HOME/.gitignore; | |
| # LATER: just edit entries like in a normal .gitignore | |
| vim $HOME/.gitignore; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // this code is not tested, sorry if there are errors, but it should do the job with a little tweaking here and there... | |
| foreach($images as $file) { | |
| $img = Image::make($file); | |
| $img->resize(null, 1000, function ($constraint) { | |
| $constraint->aspectRatio(); | |
| }); |