Inspired by similar commands tic
and toc
from Matlab.
$ tick # start a timer
$ tock # print elapsed time
2s elapsed
# add a 1-pixel #777 border and a 2-pixel offset drop shadow of 5 px radius | |
# | |
# source: https://stackoverflow.com/a/7136561 | |
function dropshadow() { | |
# inner border color and radius | |
local ibc=${DS_INNER_BORDER_COLOR:-#777} | |
local ibr=${DS_INNER_BORDER_RADIUS:-1} | |
# drop shadow color, alpha, width and offset | |
local dsc=${DS_DROP_SHADOW_COLOR:-black} |
#!/usr/bin/env python | |
# source: https://gist.github.com/cevaris/79700649f0543584009e | |
# updated to allow an arbitrary message to be displayed in front of the spinner | |
import itertools | |
import sys | |
import time | |
import threading | |
SHA1 hash of file c:\windows\notepad.exe: | |
26 40 c2 90 04 2e 09 e0 41 fa 76 ae 86 37 74 7e 10 0a 5c 2c | |
CertUtil: -hashfile command completed successfully. |
SHA1 hash of C:\windows\notepad.exe: | |
867b54f1bc5b71045a9a00baca485a24176b202c | |
CertUtil: -hashfile command completed successfully |
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings] | |
"TerminalType"="xterm-256color" | |
"FullScreenOnAltEnter"=dword:00000001 | |
; 110 characters | |
"TermWidth"=dword:0000006e | |
"Font"="Consolas" | |
; 11 point | |
"FontHeight"=dword:0000000b |
// this must be run in the browser's dev console, because XMLHttpRequests will | |
// fail in a JS Bin or a JSFiddle document | |
// | |
// useful references | |
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_using_XPath_in_JavaScript | |
var searchURL = 'https://www.ncbi.nlm.nih.gov/pubmed/?term='; | |
// this is the XPath for the part of the search results containing the PMID | |
var pmidXPath = '//dl[@class="rprtid"]/dd'; |
# written as a function; either put this somewhere and source it from your | |
# .bashrc, or else remove the function wrapper and replace all the 'return's | |
# with 'exit's. | |
# Alias 'tmux attach-session -d -t 0' to something easier to type | |
function remux() { | |
local -a sessions tmuxopts | |
local sid lastsid USAGE | |
local USELAST=0 | |
local TRACE=${TRACE:-0} |
SHELL = bash | |
SCRIPT = thescriptname | |
PREFIX ?= /usr/local | |
BINDEST = $(PREFIX)/bin | |
# this pattern works w/ a script where version is defined as "VERSION='x.y.z'" | |
# update here and line 75 if yours looks different (e.g., Perl instead of Bash) | |
PKGVER = $(shell sed -n "s/^VERSION='\(.*\)'/\1/p" $(SCRIPT)) | |
READMEURL = https://gist.github.com/ernstki/75bba9e99a85bf273e8ec0f17dba6cfe | |
# ANSI terminal colors (see 'man tput') and |
Here's a sensible .screenrc that does the following: