As configured in my dotfiles.
start new:
tmux
start new with session name:
| <?php | |
| /** | |
| * Implements hook_file_url_alter(). | |
| * | |
| * Make all URLs be protocol relative. | |
| * Note: protocol relatice URLs will cause IE7/8 to download stylesheets twice. | |
| * @see http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/ | |
| */ | |
| function custom_file_url_alter(&$url) { | 
As configured in my dotfiles.
start new:
tmux
start new with session name:
| javascript: (function () { | |
| var h = document.createElement('div'); | |
| var t = document.getElementsByTagName('title')[0]; | |
| var info = '<p><strong>Title(' + t.innerHTML.length + '):</strong> ' + t.innerHTML + '</p>'; | |
| var m = document.getElementsByTagName('meta'); | |
| for (var i = 0; i < m.length; i++) { | |
| if (null !== m[i].getAttribute('name')) { | |
| var c = m[i].getAttribute('content'); | |
| info += '<p><strong>' + m[i].getAttribute('name') + '(' + c.length + '):</strong> ' + c + '</p>'; | |
| } | 
| import pymarc | |
| from pymarc.exceptions import RecordLengthInvalid, RecordLeaderInvalid | |
| from pymarc.exceptions import BaseAddressInvalid, BaseAddressNotFound | |
| from pymarc.exceptions import RecordDirectoryInvalid, NoFieldsFound | |
| class PermissiveMARCReader(pymarc.MARCReader): | |
| """PermissiveMARCReader: recovers from most pymarc exceptions""" | |
| def __init__(self, marc_target, to_unicode=False, force_utf8=False, | |
| hide_utf8_warnings=False, utf8_handling='strict'): | |
| super(PermissiveMARCReader,self).__init__(marc_target, to_unicode, | 
| <!-- just replace {{id}} with the video's ID | |
| e.g. 9bZkp7q19f0 --> | |
| <div style="width:100%;position:relative;padding:0;padding-top:75%"> | |
| <iframe | |
| style="position:absolute;top:0;left:0;width:100%;height:100%;" | |
| src="http://www.youtube-nocookie.com/embed/{{id}}?rel=0" | |
| frameborder="0" allowfullscreen mozallowfullscreen webkitallowfullscreen> | |
| </iframe> | |
| </div> | 
(psst... need a json viewer plugin?)
| #!/bin/sh | |
| set -e | |
| set -x | |
| for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) | |
| do | |
| npm -g install "$package" | |
| done | 
| // Make sure you are on the homepage | |
| if($('#s-lg-index-list').length > 0) { | |
| // Loop through all the subjects | |
| $('#s-lg-index-cols').find('div.panel.panel-default').each(function() { | |
| // Get the number of guides in this subject | |
| var guides = $(this).find('.badge').text(); | |
| // console.log('Number of guides: ' + guides); |