Skip to content

Instantly share code, notes, and snippets.

@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)
@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 / 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 / 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 / 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 / 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 / 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 / inject.js
Created December 13, 2021 16:53 — forked from nylen/inject.js
JavaScript file to allow injecting scripts into a page using GreaseMonkey/TamperMonkey and running a callback when loading is complete. Based on http://stackoverflow.com/questions/6725272/dynamic-cross-browser-script-loading .
function inject(src, callback) {
if (typeof callback != 'function') callback = function() { };
var el;
if (typeof src != 'function' && /\.css[^\.]*$/.test(src)) {
el = document.createElement('link');
el.type = 'text/css';
el.rel = 'stylesheet';
el.href = src;
http://invisible-island.net/xterm/
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
@datygra
datygra / bookmarks-to-notion.js
Created April 11, 2022 00:24 — forked from unrevised6419/bookmarks-to-notion.js
Export browser bookmarks, import them in Notion as a database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/