Skip to content

Instantly share code, notes, and snippets.

General

  • Are all vars used somewhere?
  • Do the vars have properly cased, and meaningful names?
  • Style looks appropriate
  • No unnecessarily duplicated logic
  • Code intent is clear upon initial reading
  • Any code that isn't clear, but is needed, has an effective comment
  • Are method calls or attribute lookups every called on entities that could be undefined/null?
  • The functions can appropriately handle unexpected inputs.
  • Commented code has been removed (comments themselves are fine).
<p>To setup this bookmarklet in your browser, you'll need to:</p>
<ol>
<li>Clone (or download) this gist using the information on this page</li>
<li>Fill in your username and password</li>
<li>Change the drupal_domain variable to the domain of your drupal install</li>
<li>(Possibly) change the path to the path to your drupal login form</li>
<li>Drag the link to your bookmark bar</li>
</ol>
<p>To use, simply click the bookmark anywhere on your drupal_domain.</p>
<a href="javascript: (function(){ var user = 'username', pw = 'password', path = '/user/login', drupal_domain = '.example.com', domain = window.location.host, frame = document.createElement('iframe'), frame_length = frames.length; if(domain.indexOf(drupal_domain) !== -1){ document.body.appendChild( frame ); frame.src = '//' + domain + path; frame.style.display = 'none'; setTimeout(function() { frames[frame_length].document.getElementById('edit-name').value = user; frames[frame_length].document.getElementById('edit-pass').value = pw; frames[fr