Skip to content

Instantly share code, notes, and snippets.

View 4096void's full-sized avatar
:shipit:
wrangling

TJ 4096void

:shipit:
wrangling
View GitHub Profile
@4096void
4096void / TJ's FAQs.md
Last active November 15, 2022 08:52
google search cache for TJ's FAQs
  • get my Mac's RSA public key, pbcopy < ~/.ssh/id_rsa.pub

GR III

  • move files if destination does not exists, mv -vn from_dir/**.JPG to_dir
  • rename files, find . -depth -name "*.JPG" -exec sh -c 'f="{}"; mv -- "$f" "${f%.JPG}_1.JPG"' \;

Git

  • delete a branch locally and remotely, git branch -d ${local_branch} && git push orogin -d ${remote_branch}
  • create local branch in git then push it to remote, git checkout -b <branch> && git push -u origin <branch>
  • push to another url, git remote set-url origin
@sindresorhus
sindresorhus / writing-eslint-rule.md
Last active February 26, 2023 03:01
Gettings started writing a ESLint rule

Gettings started writing a ESLint rule

First, take a look at the ESLint rule documentation. Just skim it for now. It's very long and boring. You can come back to it later.

ESLint rules works on the AST (Abstract Syntax Tree) representation of the code. In short, this is a tree structure that describes the code in a very verbose form. ESLint walks this tree and rules can subscribe to be notified when it hits a specific node type, like a Literal type, which could be the "hello" part of const welcome = "hello";.

Go ahead and play around with some code in AST Explorer (Make sure the parser is espree). It's a great tool!

Here are some good articles on the subject (ignore the scaffolding parts):

@tpitale
tpitale / README.md
Last active February 4, 2025 22:19
Sublime Text plugin to create a simple timestamp
  1. Go to Tools > New Plugin
  2. Paste timestamp.py contents and save in User as timestamp.py
  3. Open Preferences > Key Bindings - User (or Default, your call)
  4. Paste keybindings.json, or add a line to your keybindings
  5. Customize the keyboard shortcut to your liking and save
@jm3
jm3 / looking for the mouse.md
Last active December 26, 2025 00:20
Gin, Television, and Social Surplus

Gin, Television, and Social Surplus, or, “Looking for the Mouse”

Clay Shirky / April 26, 2008

transcription of a speech [Clay Shirky] gave at the Web 2.0 in 2008, emphasis by @jm3

I was recently reminded of some reading I did in college, way back in the last century, by a British historian arguing that the critical technology, for the early phase of the industrial revolution, was gin.

The transformation from rural to urban life was so sudden, and so wrenching, that the only thing society could do to manage was to drink itself into a stupor for a generation. The stories from that era are amazing-- there were gin pushcarts working their way through the streets of London.

And it wasn't until society woke up from that collective bender that we actually started to get the institutional structures that we associate with the industrial revolution today. Things like public libraries and museums, increasingly broad education for children, elected leaders--a lot of th

@sturob
sturob / html2less.js
Created January 31, 2012 12:49
generate nested less from the DOM
// adapted www.jameswiseman.com/blog/2010/08/24/manually-traverse-a-dom-tree-using-jquery/
// requires jquery
function html2less($item, pass) {
var tmp = {};
$item = $item ? $item : $('body');
pass = pass ? pass : { max: 50, count: 0, less: "" };
$item.each(function(n, v) {