a/o 2020-05-29
--
- Restart with Cmd-R or Cmd-D
- Erase drive / 3x if second-hand
- Reinstall MacOS
/** | |
* Note that this script is intended to be included at the *end* of the document, before </body> | |
*/ | |
(function (window, document) { | |
if ('open' in document.createElement('details')) return; | |
// made global by myself to be reused elsewhere | |
var addEvent = (function () { | |
if (document.addEventListener) { | |
return function (el, type, fn) { |
/* | |
* anchor-include pattern for already-functional links that work as a client-side include | |
* Copyright 2011, Scott Jehl, scottjehl.com | |
* Dual licensed under the MIT | |
* Idea from Scott Gonzalez | |
* to use, place attributes on an already-functional anchor pointing to content | |
* that should either replace, or insert before or after that anchor | |
* after the page has loaded | |
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a> | |
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Can’t Hug Every Cat</title> | |
<style> | |
body { | |
font: 1em/1.5 Cambria, Georgia, serif; | |
margin: 0 5%; |
<figure class="quote"> | |
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote> | |
</figure> |
<?php | |
/** | |
* Infinite next and previous post looping in WordPress | |
*/ | |
if( get_adjacent_post(false, '', true) ) { | |
previous_post_link('%link', '← Previous Post'); | |
} else { | |
$first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post(); | |
echo '<a href="' . get_permalink() . '">← Previous Post</a>'; | |
wp_reset_query(); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<h2>Original CSS</h2> | |
<style style="display: block; white-space: pre; font-family: monospace"> | |
h2 { margin:0; } |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
class BaseModel(ndb.Model): | |
@classmethod | |
def populate(cls, key): | |
self = key.get() | |
sources = getattr(self.__class__, 'sources', False) | |
source_data = {} | |
if not sources: | |
return False | |
for source_name in sorted(sources.keys(), key=lambda k: 0 if k == 'gplus' else 9): | |
source_id_property = 'source_id_' + source_name |
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |