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;
}
<?php | |
// half-hearted CSS minification | |
$css = preg_replace( | |
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'), | |
array('$1{ ','$1$3;',"",'} '), | |
file_get_contents('linked.css') | |
); | |
// embed as a data: uri | |
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '='); |
/* POSIX paths in JSON via escaping which | |
doesn't alter valid UTF-8 paths. | |
The trick is recognizing that JSON can store binary nulls in strings | |
but nulls are the only character that can't occur in POSIX paths, | |
so we can use it as an escape character that won't change how existing | |
serialized paths get interpreted. | |
Copyright 2018-2020, Stephan Sokolow |
(defun update-swank () | |
"Called from within the main loop, this keep the lisp repl | |
working while cepl runs" | |
(continuable | |
(let ((connection (or swank::*emacs-connection* | |
(swank::default-connection)))) | |
(when connection | |
(swank::handle-requests connection t))))) |
(defun my-fancy-newline () | |
"Add two newlines and put the cursor at the right indentation | |
between them if a newline is attempted when the cursor is between | |
two curly braces, otherwise do a regular newline and indent" | |
(interactive) | |
(if (and (equal (char-before) 123) ; { | |
(equal (char-after) 125)) ; } | |
(progn (newline-and-indent) | |
(split-line) | |
(indent-for-tab-command)) |
#include <iostream> | |
#include <sstream> | |
#include <tuple> | |
template<class Tuple, std::size_t N> | |
struct TuplePrinter { | |
static void print(const std::string& fmt, std::ostream& os, const Tuple& t) { | |
const size_t idx = fmt.find_last_of('%'); | |
TuplePrinter<Tuple, N-1>::print(std::string(fmt, 0, idx), os,t); | |
os << std::get<N-1>(t) << std::string(fmt, idx + 1); |
(ns express | |
"Ligweight interface to requirejs." | |
(:refer-clojure :exclude [set get]) | |
(:require [cljs.nodejs :as node])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Constants | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(def ^{:doc "Global express import." |