Holy crap, I never knew about this before, but this is awesome.
The command is drush uli
It's got options,
namefor the usernameurito specify the url of the site (our weird setup requires us to specify the url of our site)
| /** | |
| * Implements hook_preprocess_HOOK(). | |
| */ | |
| function yourtheme_preprocess_block(&$variables) { | |
| $content = $variables['elements']['content']; | |
| if (isset($content['#block_content']) && $content['#block_content'] instanceof BlockContentInterface) { | |
| $variables['view_mode'] = $content['#view_mode']; | |
| } | |
| } |
| var list = []; | |
| document.querySelectorAll("body *") | |
| .forEach(function(elem){ | |
| if(elem.getBoundingClientRect().width > document.body.getBoundingClientRect().width){ | |
| list.push(elem.outerHTML.split('>')[0] + '>'); | |
| } | |
| }); | |
| confirm( "these elements are wider than the viewport:\n\n " + list.join("\n") ) |
| # Stop the HTTP storage manager (since it has an in-memory cache of the HSTS hosts). | |
| killall nsurlstoraged | |
| # Delete the HSTS cache file. | |
| rm -f ~/Library/Cookies/HSTS.plist | |
| # This may not work if Terminal is not configured for "Full Disk Access", so instead: | |
| # Open Finder, Shift+Apple+G, paste in ~/Library/Cookies/ and manually delete HSTS.plist | |
| # Start up nsurlstoraged again | |
| launchctl start /System/Library/LaunchAgents/com.apple.nsurlstoraged.plist |
| <?php | |
| // If you create a menu link titled "User Profile Image" with URL "/user", | |
| // it will be dynamically swapped with the user's profile image. | |
| /** | |
| * Implements hook_link_alter(). | |
| */ | |
| function mymodule_user_link_alter(&$variables) { | |
| /** | |
| * @var \Drupal\Core\Url |
| // Download the twitter4j jar: | |
| // wget http://twitter4j.org/maven2/org/twitter4j/twitter4j-core/4.0.4/twitter4j-core-4.0.4.jar | |
| // Fill out the key/token/secrets | |
| // Run the script | |
| // kotlinc -script -classpath ./twitter4j-core-4.0.4.jar who_posts_the_most.kts|sort -n | |
| import twitter4j.Status | |
| import twitter4j.Twitter | |
| import twitter4j.TwitterException | |
| import twitter4j.TwitterFactory |
| [ | |
| { | |
| "name": "JD40" | |
| }, | |
| [ | |
| { | |
| "c": "#dd1126" | |
| }, | |
| "Esc", | |
| { |
| (function ($, Drupal, window, document) { | |
| 'use strict'; | |
| // Example of Drupal behavior loaded. | |
| Drupal.behaviors.exampleJS = { | |
| attach: function (context, settings) { | |
| if (typeof context['location'] !== 'undefined') { // Only fire on document load. | |
| console.log('This is loaded'); |
To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:
$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd