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'
@shinypb
shinypb / gist:2855218
Created June 1, 2012 21:24
Async Deck loading code
<div id="SidebarTheDeck">
<script type="text/javascript">
(function(id) {
var theDeck = document.createElement('script'); theDeck.type = 'text/javascript'; theDeck.async = true;
theDeck.src = 'http://connect.decknetwork.net/deck' + id + '_js.php?' + (new Date().getTime());
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(theDeck, s);
})("DF");
</script>
</div>
<style type="text/css">
#banner img { width: 240px; height: 56px; }
#banner img.retina { display: none; }
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
#banner img.non-retina { display: none; }
#banner img.retina { display: block; }
}
</style>