Skip to content

Instantly share code, notes, and snippets.

View murtaugh's full-sized avatar
👋

Tim Murtaugh murtaugh

👋
View GitHub Profile
@murtaugh
murtaugh / eems-droplet-for-EE2.md
Last active October 27, 2021 03:33
Set up a DigitalOcean droplet for ExpressionEngine

(This is an updated version of Clearfire's tutorial, which is excellent, but has become slightly outdated as Digital Ocean updates their applications.)

  1. Create your droplet. Name it, select your size and location, then hit the Applications tab and select (as of this writing) "LAMP on 14.04". Add your SSH key if you want, and submit.
  2. SSH into your new droplet, and maybe check to make sure the following PHP modules have been installed: (In my recent experience, these have all been installed automatically, but that could change, and it takes 10 seconds to check.)

    apt-get install php5-gd

    apt-get install php5-mysql

    apt-get install php5-curl

  3. Make sure mod_rewrite is enabled, with a2enmod rewrite.
  4. If you like, increase PHP's upload_max_filesize and post_max_filesize values by editing the php.ini file, with this: nano /etc/php5/apache2/php.ini
  5. Give Apach
@murtaugh
murtaugh / tabmaster.html
Created July 24, 2015 15:29
Tabmaster: in-page tab navigation management
<label for="username">Username</label>
(<a id="register-link" data-tabto="reset-link" href="#">register</a>)
<input id="username" type="text" data-tabmaster="true" data-tabto="password" />
<label for="password">Password</label>
(<a id="reset-link" data-tabto="submit" href="#">reset password</a>)
<input id="password" type="password" data-tabto="register-link" />
<input id="submit" data-tabmaster="false" type="submit" value="Submit" />
@murtaugh
murtaugh / deprecated-snippets.html
Last active August 29, 2015 14:25
Deprecated ALA Responsive Image Snippets
<figure data-picture data-alt="">
<div data-src="<!-- URL for standard image here -->"></div>
<div data-src="<!-- URL for high-DPI image here -->" data-media="(min-device-pixel-ratio: 2.0)"></div>
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
<noscript><img src="<!-- URL for standard image here -->" alt=""></noscript>
</figure>
<figure data-picture data-alt="">
<div data-src="<!-- URL for small-screen image here -->" data-media="(max-width: 700px)"></div>
@murtaugh
murtaugh / new-eecms-mime-type
Last active August 29, 2015 14:15
Update ExpressionEngine's list of MIME types
'svg' => 'image/svg+xml',
@murtaugh
murtaugh / eecms-update-for-ala
Last active August 29, 2015 14:06
A List Apart migration plan
0. Make sure local and dev files are in synch.
1. turn off comments on prod
... by hiding the comment form
2. clear caches on prod
3. turn off local
4. clear caches on local
5. make local copy of prod db
@murtaugh
murtaugh / hide menu,js
Created May 20, 2014 14:51
The right way to close a menu (without preventing event bubbling)
$(document).on('click', function(event) {
if (!$(event.target).closest('#menucontainer').length) {
// Hide the menus.
}
});
@murtaugh
murtaugh / keyboard-controls.js
Last active August 29, 2015 13:57
Keyboard Controls
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if ((e.keyCode == '39') || (e.keyCode == '40')) { // right / down arrow
console.log('right / down');
@murtaugh
murtaugh / handle-missing-image.js
Last active August 29, 2015 13:57
If an image fails, what do we do? In my case, maybe I've already defined a backup (usually in the case of inline SVGs), so we should look for that first. If that fails, then we'll hide the image (or do whatever the context requires).
$('img').on('error', function(){
//console.log('img load failure: ' + $(this).attr('src'));
var fallback = $(this).attr('data-fallback');
if (typeof fallback !== 'undefined' && fallback !== false) {
$(this).attr('src', fallback);

Keybase proof

I hereby claim:

  • I am murtaugh on github.
  • I am murtaugh (https://keybase.io/murtaugh) on keybase.
  • I have a public key whose fingerprint is D47C 9FB7 E5D4 4EC1 DD55 6D3D BE9F DFE5 D9A1 EB0F

To claim this, I am signing this object:

.notched-box {
position: relative;
width: 50%;
height: 200px;
margin: 2em auto;
padding: 2em 0;
background: #eee;
overflow: hidden;
}