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;
}
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
fshow() { | |
local out shas sha q k | |
while out=$( | |
git log --graph --color=always \ | |
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
--print-query --expect=ctrl-d --toggle-sort=\`); do | |
q=$(head -1 <<< "$out") | |
k=$(head -2 <<< "$out" | tail -1) |
macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.
Instead of tmux-256color
, use screen-256color
which comes with system. Place this command into ~/.tmux.conf
or ~/.config/tmux/tmux.conf
(for version 3.1 and later):
#![feature(mpsc_select, box_syntax)] | |
use std::io; | |
use std::process::Command; | |
use std::sync::mpsc::{channel, Receiver, Select}; | |
use std::string::FromUtf8Error; | |
use std::thread::spawn; | |
#[derive(Debug)] | |
enum PipeError { |
source "http://rubygems.org/" | |
gem "sinatra", "~> 1.3.0" | |
gem "thin" |
# you'd obviously have more settings somewhere | |
set :scm, :git | |
set :repository, "git@github.com:defunkt/github.git" | |
set :branch, "origin/master" | |
set :migrate_target, :current # this tells capistrano where to run the migration. otherwise it would try to use the latest release directory (/path/to/app/releases/2012XXXXXXXXX) | |
set :use_sudo, false | |
set :ssh_options, {:forward_agent => true} # so you can checkout the git repo without giving the server access to the repo | |
set :rails_env, 'production' | |
# These are here to override the defaults by cap |
# Has your OS/FS/disk lost your data? | |
# cd to the directory containing your project repositories and run the command | |
# below. (It's long; make sure you get it all.) It finds all of your git repos | |
# and runs paranoid fscks in them to check their integrity. | |
(set -e && find . -type d -and -iname '.git' | while read p; do (cd "$(dirname "$p")" && (set -x && git fsck --full --strict)); done) && echo "OK" | |
# I have 81 git repos in my ~/proj directory and had no errors. |
#!/bin/sh | |
# Extracted from: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html#usage | |
palette="/tmp/palette.png" | |
filters="fps=15,scale=640:-1:flags=lanczos" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 |
#!/usr/bin/env rc | |
if (! ~ $#* 1) { | |
echo 'Usage: sc <pattern>' | |
} else { | |
grep $1: $0 | |
} | |
# 100: Continue | |
# 101: Switching Protocols |