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;
}
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f | |
# Changes: | |
# * Instead of overriding cd, we detect directory change. This allows the script to work | |
# for other means of cd, such as z. | |
# * Update syntax to work with new versions of fish. | |
# * Handle virtualenvs that are not located in the root of a git directory. | |
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change" | |
status --is-command-substitution; and return |
function sponge | |
/usr/bin/mkdir -p (dirname "$argv") | |
/usr/bin/sponge "$argv" | |
end | |
function tee | |
/usr/bin/mkdir -p (dirname "$argv") | |
/usr/bin/tee "$argv" | |
end |
In order to use the 80 or 443 ports on Mac OS without the need to start web server with root:
echo "rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080" | sudo pfctl -ef -
echo "rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443" | sudo pfctl -ef -
// component | |
type AnotherType = { | |
data: { | |
id: string | |
} | |
} | |
type Props = { | |
aFunction: ({ id: string }) => AnotherType | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
<link href="https://fonts.googleapis.com/css?family=Stint+Ultra+Expanded" rel="stylesheet"> | |
</head> | |
<body> | |
<p>Guess between: 1-15</p> | |
<input id= "one"><button id="first">Submit</button> | |
<div class="sup">You Guessed:</div><div id="word"></div> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<input><button>Submit</button> | |
<div>You guessed:</div><div id="word"></div> | |
<div id="WL"></div> | |
<div id="img"></div> |
-- Inspired by https://github.com/jasoncodes/dotfiles/blob/master/hammerspoon/control_escape.lua | |
-- You'll also have to install Karabiner Elements and map caps_lock to left_control there | |
len = function(t) | |
local length = 0 | |
for k, v in pairs(t) do | |
length = length + 1 | |
end | |
return length | |
end |
This script is modeled after tee
(see [man tee
][2]) and works on Linux, macOS, Cygwin, WSL/WSL2
It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.
This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]
(ns helloserver | |
(:require [cljs.nodejs :as nodejs])) | |
(def http (nodejs/require "http")) | |
(-> (.createServer http (fn [req res] | |
(doto res | |
(.writeHead 200 {"Content-Type" "text/plain"}) | |
(.end "Hello from ClojureScript")))) | |
(.listen 8080 "127.0.0.1")) |