Skip to content

Instantly share code, notes, and snippets.

@ryon
ryon / gist:0868cb8ae754981fe4c1f03425f4f4ec
Created August 29, 2021 02:34
John Gruber Title Case Bookmarklet Source
// enter this code on e.g., https://bookmarklets.org/maker/ to create a bookmarklet
const input = prompt('Enter text to convert to Title Case');
prompt('Converted text below:', input.toTitleCase());
/* To Title Case © 2018 David Gouch | https://github.com/gouch/to-title-case */
// eslint-disable-next-line no-extend-native
String.prototype.toTitleCase = function () {
'use strict'
@ryon
ryon / index.pug
Created January 25, 2018 00:05
V2 Newsletter
// https://litmus.com/community/learning/24-how-to-code-a-responsive-email-from-scratch
doctype html
html(lang="en")
head
link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,700")
style.
/* Some resets and issue fixes */
#outlook a { padding:0; }
body{ width:100% !important; -webkit-text; size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0; }
@ryon
ryon / keybase.md
Created May 4, 2017 02:07
keybase.md

Keybase proof

I hereby claim:

  • I am ryon on github.
  • I am ryon (https://keybase.io/ryon) on keybase.
  • I have a public key ASCeELKNaa43NhLjTgqKzr_C7OCAHmThpBt7C2mem7L2rAo

To claim this, I am signing this object:

css {
should-look: like-this;
/* one space after the selector */
/* opening brace on the same line */
/* 4-space indent */
/* closing brace on its own line */
/* one blank line between rules */
}
.one-liners { can-look: like-this; } /* but only do this if the rule has only one property and it's unlikely to gain more */
@ryon
ryon / yt-expand
Created September 5, 2013 19:35
Bookmarklet to expand a YouTube embed iframe to fill the window (will collapse if used again)
javascript:(function()%7Bvar%20yt=document.querySelector('iframe%5Bsrc*=%22youtube.com/embed%22%5D'),ytExpanded=!!yt.dataset.iframeExpanded,ytStyle=yt.style;if(ytExpanded)%7Byt.style.cssText=yt.dataset.ytOldStyle;yt.removeAttribute('data-iframe-expanded');%7Delse%7Byt.dataset.ytOldStyle=ytStyle.cssText;yt.dataset.iframeExpanded=true;ytStyle.position='absolute';ytStyle.width='94%25';ytStyle.height='94%25';ytStyle.boxShadow='0%200%203em%20rgba(0,%200,%200,%20.8)';ytStyle.top='3%25';ytStyle.left='3%25';%7D%7D)();
@ryon
ryon / enable-zoom
Last active December 14, 2015 22:29
Bookmarklet to enable zoom on pages that disable it in the viewport meta tag. Not well-tested, seems to work in Safari for iOS 6.
javascript:(function(){var%20vp=document.querySelector('meta[name=viewport]');if(vp){vpParts=vp.content.split(',');vpParts=vpParts.map(function(v,i,a){if(v.indexOf('user-scalable')>-1){return%20'user-scalable=1';}else{return%20v;}});vp.content=vpParts.join(',');}else{return%20false;}})();