Install the XDebug plugin for Atom and then add the following to the config.cson file (Atom > Config…):
"php-debug":
PathMaps: [
"remotepath;localpath"
"/server/path/to/project/;/local/path/to/project/"
]
ServerPort: 9001
| <?php | |
| // Use a closure so nothing leaks out when included. | |
| return (function () { | |
| $array = ['foo', 'bar']; | |
| foreach ($array as $string) { | |
| // Some exciting logic. | |
| } | |
| return 'FOOBAR'; |
| #!/usr/bin/env bash | |
| # Convert MKV to MP4 | |
| # Uses Docker FFMpeg, FFMpeg or AVConv. | |
| # | |
| # Usage: | |
| # ./convert_video.sh | |
| # ./convert_video.sh /path/to/videos | |
| # | |
| # Notes: |
| #!/usr/bin/env bash | |
| brew tap homebrew/homebrew-php | |
| brew install php71 | |
| cd ~/.atom/packages/php-integrator-base/core | |
| /usr/local/bin/php ./composer.phar create-project php-integrator/core ./3.0.0 3.0.0 --prefer-dist --no-dev |
Install the XDebug plugin for Atom and then add the following to the config.cson file (Atom > Config…):
"php-debug":
PathMaps: [
"remotepath;localpath"
"/server/path/to/project/;/local/path/to/project/"
]
ServerPort: 9001
| package main | |
| import "fmt" | |
| const ( | |
| FIZZ = 3 | |
| BUZZ = 5 | |
| FIZZBUZZ = 15 | |
| ) |
| // Usage: game-save-clean-up --src="/Files/Game Saves" [--limit=2] [--dryrun] | |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "path/filepath" |
| package gists | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "net/http" | |
| ) | |
| type Api struct { | |
| client *http.Client |
| <?php | |
| // https://mlocati.github.io/php-cs-fixer-configurator/ | |
| return PhpCsFixer\Config::create() | |
| ->setRules([ | |
| '@PSR2' => true, | |
| 'align_multiline_comment' => ['comment_type' => 'all_multiline'], | |
| 'array_indentation' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'backtick_to_shell_exec' => true, |
To clone a gist:
git clone [email protected]:[GIST ID].git
If you need to add a remote to an existing repository:
git remote add origin [email protected]:[GIST ID].git
| // Usage: go run main.go https://www.theguardian.com/uk | |
| // Based on Monolith: https://github.com/Y2Z/monolith | |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/base64" | |
| "fmt" | |
| "io" | |
| "io/ioutil" |