Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
sudo exit

David Blue extratone

🗿
sudo exit
View GitHub Profile
{
"status": "OK",
"last_updated": "2017-11-04",
"basic_syntax": [
{
"name" : "Blockquotes",
"description" : "To create a blockquote, add a `>` in front of a paragraph.",
"examples" : [
{
@extratone
extratone / cheat-sheet.json
Created October 29, 2022 19:06 — forked from mattcone/cheat-sheet.json
cheat-sheet.json
{
"status": "OK",
"last_updated": "2017-11-10",
"cheat_sheet": [
{
"basic_syntax": [
{
"element" : "Blockquotes",
"syntax" : "> blockquote"
@extratone
extratone / shellfishwidget.sh
Created October 13, 2022 06:18 — forked from idnovic/shellfishwidget.sh
shellfish widget
#!/bin/bash
source .bashrc
loadavg=$(cat /proc/loadavg | awk '{print $2}' | sed 's/[^0-9]*//g')
cpucount=$(sed -n '/ cores/ s/[^0-9]//gp' /proc/cpuinfo | sed '1,1d')
cpu=$(($loadavg/$cpucount))
memtotal=$(sed -n '/^MemTotal:/ s/[^0-9]//gp' /proc/meminfo)
memavail=$(sed -n '/^MemAvailable:/ s/[^0-9]//gp' /proc/meminfo)
mem=$(((($memtotal-$memavail))/($memtotal/100)))
@extratone
extratone / every
Created October 12, 2022 06:38 — forked from sorbits/every
Run «command» only every «number» time invoked
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@extratone
extratone / x.js
Created October 4, 2022 00:38 — forked from sindresorhus/x.js
Copy + paste + devtools
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+
@extratone
extratone / gist:94972516d5f552bc9b00b8d2a4b39905
Created September 25, 2022 07:55 — forked from palmin/gist:14300e8bf529d05e7e53
Get fonts family and font names list on iOS
// List all fonts on iPhone
for (NSString* family in [UIFont familyNames]) {
NSLog(@"Family name: %@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family]) {
NSLog(@" Font name: %@", name);
}
}
# include this from .bashrc, .zshrc or
# another shell startup file
# this script does nothing outside ShellFish
if [ "$LC_TERMINAL" = "ShellFish" ]; then
printURIComponent() {
awk 'BEGIN {while (y++ < 125) z[sprintf("%c", y)] = y
    while (y = substr(ARGV[1], ++j, 1))
    q = y ~ /[a-zA-Z0-9]/ ? q y : q sprintf("%%%02X", z[y])
    printf("%s", q)}' "$1"
@extratone
extratone / gz_extract.py
Created September 25, 2022 04:34 — forked from kstreepy/gz_extract.py
For a given directory, unzip all .gz files in folder, save unzipped files in folder and deleted zipped files. A python solution for instances where you do not have access to PowerShell.
import os, gzip, shutil
dir_name = 'x'
def gz_extract(directory):
extension = ".gz"
os.chdir(directory)
for item in os.listdir(directory): # loop through items in dir
if item.endswith(extension): # check for ".gz" extension
gz_name = os.path.abspath(item) # get full path of files
@extratone
extratone / screenshot-tool.sh
Created September 22, 2022 13:35 — forked from corbindavenport/screenshot-tool.sh
Bash script for automatically capturing screenshots
# How to use:
# ./screenshot-tool.sh [export directory] [seconds between screenshots]
# Example: ./screenshot-tool.sh ~/Pictures 5
# Install scrot if it's not already installed
if ! [ -x "$(command -v scrot)" ]; then
sudo apt install -y scrot
fi
# Set directory to parameter $1