Here's a trick to avoid repeating a list of things in multiple places:
#define ENUMERATE_THINGS \
ENUMERATE_THING(Foo) \
ENUMERATE_THING(Bar) \
ENUMERATE_THING(Baz)
#define ENUMERATE_THING(thing) thing
ENUMERATE_THINGSHere's a trick to avoid repeating a list of things in multiple places:
#define ENUMERATE_THINGS \
ENUMERATE_THING(Foo) \
ENUMERATE_THING(Bar) \
ENUMERATE_THING(Baz)
#define ENUMERATE_THING(thing) thing
ENUMERATE_THINGS| {# | |
| Resets the username, password, and email address | |
| of the first found Admin account in case of | |
| lost admin access or for support cases. | |
| #} | |
| {% set values = { | |
| username: 'me', | |
| password: craft.app.security.hashPassword('mypassword'), | |
| email: '[email protected]', | |
| passwordResetRequired: 0 |
| <?php | |
| // When using: | |
| // `ngrok http -host-header=example.dev 80` | |
| $isNgrok = array_key_exists("HTTP_X_ORIGINAL_HOST", $_SERVER) && strpos($_SERVER["HTTP_X_ORIGINAL_HOST"], "ngrok"); | |
| $host = 'http://' . $_SERVER[$isNgrok ? 'HTTP_X_ORIGINAL_HOST' : 'SERVER_NAME'] . '/'; | |
| return array( |
| // Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
| // See also: http://www.paulund.co.uk/change-url-of-git-repository | |
| $ cd $HOME/Code/repo-directory | |
| $ git remote rename origin bitbucket | |
| $ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
| $ git push origin master | |
| $ git remote rm bitbucket |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |