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
| # Replace [IP], [USER], [KEY] and [PLAYBOOK] | |
| # Comma after IP address is required, otherwise the command won't work. | |
| ansible-playbook -i [IP], --user=[USER] --private-key=[KEY] [PLAYBOOK] |
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
| // On error send to backend route which will log error into central logging service. | |
| window.onerror = function(message, file, line) { | |
| fetch( | |
| '/log/js-error', | |
| { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| body: JSON.stringify({ |
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
| // Create a video with the path: ./media/test.mkv | |
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "text/template" | |
| ) | |
| func main() { |
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
| #!/bin/bash | |
| # Sometimes it's useful to know if Composer actually needs updating or if it was updated, for example for CI builds. | |
| # 1) Check if you're running the latest version of Composer. | |
| # - https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c | |
| # - https://superuser.com/questions/363865/how-to-extract-a-version-number-using-sed | |
| LATEST_COMPOSER_VERSION="$(curl --silent "https://api.github.com/repos/composer/composer/tags" | jq -r '.[0].name')" | |
| CURRENT_COMPOSER_VERSION="$(composer --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p')" | |
| if [ $LATEST_COMPOSER_VERSION != $CURRENT_COMPOSER_VERSION ]; then |
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
| #!/bin/bash | |
| mkdir -p ~/.bin | |
| curl -sS https://getcomposer.org/installer | php -- --install-dir=~/.bin --filename=composer |
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 | |
| Artisan::command('db:open {connection?}', function ($connection = null) { | |
| if (! file_exists('/Applications/TablePlus.app')) { | |
| $this->warn('This command uses TablePlus, are you sure it\'s installed?'); | |
| $this->line("Install here: https://tableplus.com/\n"); | |
| } | |
| $driver = $connection ?: config('database.default'); | |
| $host = config("database.connections.{$driver}.host"); |
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 | |
| // app/Console/Kernel.php | |
| namespace App\Console; | |
| use Doctrine\ODM\MongoDB\Tools\Console\Command\ClearCache\MetadataCommand; | |
| use Doctrine\ODM\MongoDB\Tools\Console\Command\{GenerateHydratorsCommand, GeneratePersistentCollectionsCommand, GenerateProxiesCommand, QueryCommand}; | |
| use Doctrine\ODM\MongoDB\Tools\Console\Command\Schema\{CreateCommand, DropCommand, ShardCommand, UpdateCommand, ValidateCommand}; | |
| use Doctrine\ODM\MongoDB\Tools\Console\Helper\DocumentManagerHelper; | |
| use Illuminate\Console\Scheduling\Schedule; | |
| use Illuminate\Foundation\Console\Kernel as ConsoleKernel; |
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 | |
| // Extract favicon images from file path. | |
| $faviconFile = __DIR__ . '/bbc.ico' | |
| file_put_contents($faviconFile, file_get_contents('https://www.bbc.co.uk/favicon.ico')); | |
| $imagick = new Imagick(); | |
| $imagick->readImage($faviconFile); | |
| $imagick->writeImages(__DIR__ . '/bbc-extracted.png', false); | |
| // Extract favicon images from string. |
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
| #!/usr/bin/env bash | |
| # Extract images from a PDF: https://askubuntu.com/questions/117143/command-line-tool-to-bulk-extract-images-from-a-pdf | |
| sudo apt-get install poppler-utils | |
| pdfimages -all input.pdf images/image | |
| # Build PDF from images: https://stackoverflow.com/questions/8955425/how-can-i-convert-a-series-of-images-to-a-pdf-from-the-command-line-on-linux | |
| sudo apt install img2pdf | |
| img2pdf --output d.pdf images/image*.jpg |
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
| Community Bonus Pack | |
| -------------------- | |
| Homepage Download Links: https://web.archive.org/web/20150707182232/http://cbp.beyondunreal.com/download | |
| CBP 1 - 4 Installer, Zip, PS3 : http://www.mapraider.com/profiles/CommunityBonusPack/maps | |
| CBP 1 Installer, Zip, PS3: http://www.mapraider.com/maps/unreal-tournament-3/capture-the-flag/4322/Community-Bonus-Pack-3-Volume-1 | |
| CBP 1 Installer: http://www.fileplanet.com/188272/180000/fileinfo/Unreal-Tournament-3---Community-Bonus-Pack-3:-Volume-1 | |
| CBP 2 Installer, Zip, PS3: http://www.mapraider.com/maps/unreal-tournament-3/capture-the-flag/4343/Community-Bonus-Pack-3-Volume-2 |