When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
// Create a Worker we want to share memory with: | |
let w = new Worker(`data:text/javascript, | |
onmessage = ({data: memory}) => { | |
// Got WebAssembly.Memory once, log same instance forever with no further postMessages: | |
setInterval(() => console.log('Current buffer in worker:', memory.buffer), 5_000); | |
} | |
`); | |
// Create a shared growable memory: | |
let m = new WebAssembly.Memory({ initial:1, maximum: 65536, shared: true }); | |
// Send memory to the worker: |
Functions | |
startElement | |
endElement | |
_wp_menu_output | |
_add_themes_utility_last | |
_wp_ajax_delete_comment_response | |
_wp_ajax_add_hierarchical_term | |
wp_link_manager_disabled_message | |
_wp_credits_add_profile_link |
with recursive thread as ( | |
select id, in_reply_to_status_id, 0 as depth | |
from tweets | |
where in_reply_to_status_id is null | |
union | |
select tweets.id, tweets.in_reply_to_status_id, 1 + thread.depth as depth | |
from thread join tweets on tweets.in_reply_to_status_id = thread.id) | |
select * from thread order by depth desc |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
1. install postgres | |
2. run makedb.rb >tiles.csv | |
3. run tiles.sql | |
4. run archive.rb | |
5. enjoy |
(function () { | |
// If the browser supports Microsoft High Contrast Mode... | |
if (window.matchMedia('(-ms-high-contrast: none), (-ms-high-contrast: active)').matches) { | |
// Get all the SVGs on the page except the symbol defs | |
var svgs = document.querySelectorAll('svg:not(.defs)') | |
// ... iterate over SVGs | |
Array.prototype.forEach.call(svgs, function(svg) { | |
// Set preserveAspectRatio to 'XMidYMin slice' | |
svg.setAttribute('preserveAspectRatio', 'xMidYMin slice') |