Skip to content

Instantly share code, notes, and snippets.

@jcaw
jcaw / termux-download-video
Last active September 24, 2025 09:21
Download a video with termux
#!/data/data/com.termux/files/usr/bin/zsh
#
# To run this script, call it directly with the URL as the only argument.
# โžœ ./download-video [video_url]
#
# Save this script as ~/download-video
# โžœ cd ~
# โžœ curl [gist_url] > download-video
#
# Make it executable
@jcaw
jcaw / termux-url-opener
Last active July 9, 2023 12:09
Termux Audiobook/Podcast Downloader
#!/data/data/com.termux/files/usr/bin/zsh
#
# The `~/bin/termux-url-opener` script is invoked when a URL is "shared"
# to Termux, with the URL as the first parameter ($1). To use this
# script, save it under `~/bin/termux-url-opener`, then share e.g. a
# YouTube video and select Termux. It will be downloaded, converted to
# mp3 and saved as an audiobook automatically.
#
#
# Save this script as ~/bin/termux-url-opener
@jcaw
jcaw / latency.txt
Created June 12, 2020 07:16 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@jcaw
jcaw / README.md
Created May 23, 2020 22:27 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„

@jcaw
jcaw / termux-url-opener
Created January 29, 2020 15:18 — forked from LordH3lmchen/termux-url-opener
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
#
#
# How to use this script
#############################
# Create the bin directory
# โžœ ~ mkdir bin
@jcaw
jcaw / termux-url-opener
Created January 29, 2020 14:27 — forked from aziascreations/termux-url-opener
Termux URL opener script with youtube downloader
#!/bin/bash
clear
bold=$(tput bold)
normal=$(tput sgr0)
if [[ $1 =~ ^.*youtu.*$ ]]; then
echo "${bold}Youtube-dl${normal}"
echo "> ${1}"
@jcaw
jcaw / insert-commands-from-package.el
Last active July 3, 2018 00:16
Emacs: create a table of all commands from a package. Inserts all commands with a given prefix into a table, with the first line of their docstrings. Useful for GitHub readmes.
(defun insert-command-into-table (command-symbol)
"Insert an individual command into the commands table."
(let* ((command-name (symbol-name command-symbol))
(fdoc (or (documentation command-symbol t) "(Not documented.)"))
(fdoc-short (and (stringp fdoc)
(substring fdoc 0 (string-match "\n" fdoc)))))
(insert (format "| `%s` | %s |" command-name fdoc-short))
(insert "\n")))