Skip to content

Instantly share code, notes, and snippets.

@datygra
datygra / tot.sh
Created July 14, 2021 18:26 — forked from chockenberry/tot.sh
A shell script for Tot
#!/bin/sh
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
@datygra
datygra / closest
Created April 15, 2021 05:59 — forked from ii5nvk/closest
closest
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (element.matches(selector)) return element;
element = element.parentNode;
}
}
@datygra
datygra / readme.md
Created February 23, 2021 19:03 — forked from kognise/readme.md
GitHub and Obsidian
  • Create a repository and set it to private if you want
  • In your vault, run these commands substituting the values
    git init
    git add .
    git commit -m "Initial commit"
    git remote add origin git@github.com:<USERNAME>/<REPO_NAME>.git
    git push -u origin master
    
  • Now...
@datygra
datygra / iterm2.md
Created December 7, 2020 17:46 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@datygra
datygra / private_fork.md
Created November 12, 2020 08:05 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@datygra
datygra / every
Created November 12, 2020 02:10 — 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
}
@datygra
datygra / 0.README.md
Last active February 7, 2022 18:50 — forked from izabera/0.README.md
Synced via Snip

This is the table from man 5 terminfo.

Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.

indicates that padding may be specified
(P)