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;
}
### extract videos as mp3 files | |
youtube-dl -x --audio-format mp3 <video link> | |
### get highest resolution audio & video | |
To download a video, you type the URL after the command like so: | |
youtube-dl <video link> | |
To select the video quality, first use the -F option to list the available formats, here’s an example, |
#!/bin/sh | |
deadlink() { | |
local NO_ABS=false | |
local NO_REL=false | |
while [ $# -gt 0 ]; do | |
case "$1" in | |
('-h'|'--help') | |
echo "Usage: $0 [--na|--no-absolute]|[--nr|--no-relative] [--] <directory>"; | |
exit 0; |
#!/usr/bin/lua | |
-- load the http socket module | |
http = require("socket.http") | |
-- load the json module | |
json = require("json") | |
api_url = "http://api.openweathermap.org/data/2.5/weather?" | |
-- http://openweathermap.org/help/city_list.txt , http://openweathermap.org/find | |
cityid = "5128581" |
#!/bin/sh | |
# "include: /var/unbound/etc/ad-blacklist.conf" in /var/unbound/etc/unbound.conf | |
# run script as daily cron | |
TMPFILE=$( mktemp get_dns_blacklists-XXXXXXXXX ) | |
trap 'rm -f $TMPFILE; exit 1' EXIT KILL INT QUIT TERM | |
( | |
ftp -VM -o- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | grep ^0.0.0.0 | awk '{ print $2 }' |
/* | |
* An URI datatype. Based upon examples in RFC3986. | |
* | |
* TODO %-escaping | |
* TODO split apart authority | |
* TODO split apart query_string (on demand, anyway) | |
* | |
* @(#) $Id$ | |
*/ |
#!/bin/sh | |
if [ -n "$1" ]; then | |
if [ "$1" = "grab_id" ]; then | |
xdotool selectwindow >/tmp/autoreload_window_id | |
elif [ "$1" = "reload" ]; then | |
WINDOWID=`cat /tmp/autoreload_window_id` |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
#!/bin/bash | |
#get hex codes in form #fff and #ffffff | |
#checks to see if not - especially needed on #fff matches | |
#FIXME: - currently prints trailing character | |
if [[ ! -a $1 ]]; then | |
echo File not found | |
exit 1 | |
fi | |
sed ':a;N;$!ba;s/\n/ /g' "$1" | grep -o '\#[0-9a-fA-F]\{3\}[^0-9a-fA-F]' | sed 's/[^0-9a-fA-F#]//g' | sort -u |