This is a shotgun blast of commands I use from terminal for fun and profit. Some say I'm crazy for living in the "black screen", I like to think of it as a Terminal Illness.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH inputs AS ( | |
SELECT | |
row_number() over () as idx, | |
letter | |
FROM unnest(ARRAY['a', 'b', 'c', 'd']) letters(letter) | |
) | |
SELECT | |
a.letter, | |
b.letter | |
FROM inputs a, inputs b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sayLastChild(selector) { | |
// Select the node that will be observed for mutations | |
const targetNode = document.querySelector(selector); | |
// Options for the observer (which mutations to observe) | |
const config = { attributes: true, childList: true, subtree: true }; | |
// Callback function to execute when mutations are observed | |
const callback = function(mutationsList, observer) { | |
// Use traditional 'for loops' for IE 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | color | meta | |
---|---|---|---|
1 | red | {"x":123} | |
2 | green | {"y":456} | |
3 | blue | {"x":789,"y":234} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src_dir = sources | |
dist_dir = dist | |
cbr_files = $(wildcard $(src_dir)/*.cbr) | |
pdf_files = $(cbr_files:$(src_dir)/%.cbr=$(dist_dir)/%.pdf) | |
image_dir = .images-$< | |
all: ${pdf_files} | $(dist_dir) | |
@echo Done | |
clean: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Ads | |
// @namespace https://ddrscott.github.io/remove_ads | |
// @version 0.5 | |
// @description Removes elements that are thought to be ads. | |
// @author Scott Pierce | |
// @match https://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simulateKey (keyCode, type, modifiers, elm) { | |
var evtName = (typeof(type) === "string") ? "key" + type : "keydown"; | |
var modifier = (typeof(modifiers) === "object") ? modifier : {}; | |
var event = document.createEvent("HTMLEvents"); | |
event.initEvent(evtName, true, false); | |
event.keyCode = keyCode; | |
for (var i in modifiers) { | |
event[i] = modifiers[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import termios | |
import tty | |
import threading | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export LC_ALL=C.UTF-8 | |
export LANG=C.UTF-8 | |
export LANGUAGE=C.UTF-8 | |
# Terminal settings and colors | |
export TERM=xterm-256color | |
export BASE16_THEME=ocean |