Skip to content

Instantly share code, notes, and snippets.

View smarchetti's full-sized avatar

Sean Marchetti smarchetti

View GitHub Profile
@smarchetti
smarchetti / tananodes_cheatsheet.md
Created February 10, 2025 16:05 — forked from mi5ty/tananodes_cheatsheet.md
Tana Cheat Sheet

%%tana%%

  • Cheat Sheet
    • ✨ Tana Expressions
      • Title #tana-expression
        • Description:: A title expression composes values from the node into a title.
        • Attributes:: Search for Tana "Title" Attributes
      • Search #tana-expression
        • Description:: The search expression consists of a flat list of match-clauses that must be true for a node to match the search.
        • Attributes:: Search for Search Attributes + Search for Search Field Values
  • 🧩 Tana Attributes
@smarchetti
smarchetti / bootstrap-reop.sh
Last active January 8, 2025 03:05
This script automates the setup process for cloning and configuring your dotfiles repository on a new machine. It is specifically designed to handle environments with GitHub SSH authentication and streamline the initial configuration steps.
#!/bin/bash
# Usage function
usage() {
echo "Usage: $0 -e <email> -r <owner/repo> -d <destination>"
echo
echo " -e Email address for SSH key generation"
echo " -r GitHub repository in the format owner/repo"
echo " -d Destination directory for the cloned repository"
exit 1
@smarchetti
smarchetti / Homebrew Zsh on Mac
Created October 16, 2024 02:48 — forked from ngocphamm/Homebrew Zsh on Mac
Notes on using Homebrew Zsh as default login shell
1. Install Zsh with Homebrew
brew install zsh
2. Add "/usr/local/bin/zsh" to "/etc/shells" file
sudo vim /etc/shells
3. Change to default login shell
chsh -s /usr/local/bin/zsh $USER
4. Make sure new version of Zsh is in active
@smarchetti
smarchetti / git-branches-by-commit-date.sh
Created February 12, 2018 19:46 — forked from mt3/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@smarchetti
smarchetti / delete-all-docker-containers-and-images.sh
Last active February 9, 2018 13:30
Delete all Docker containers and images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

Keybase proof

I hereby claim:

  • I am smarchetti on github.
  • I am seanmarchetti (https://keybase.io/seanmarchetti) on keybase.
  • I have a public key ASDpBhZspKKvf-1mQK6zSGsUpbPpNXX6XGuwyfCzN3G9ngo

To claim this, I am signing this object:

@smarchetti
smarchetti / recursively-delete-all-ds_store-files.sh
Last active February 9, 2018 13:31
Recursively delete all .DS_Store files
#!/bin/bash
find . -name '.DS_Store' -type f -delete
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://www.mydomain.com/new-page.html">
</head>
<body>
</body>
</html>
const streamz = require('streamz')
const ProgressBar = require('progress')
const createBar = (total) => new ProgressBar(' processing [:bar] :percent', {
complete: '=',
incomplete: ' ',
width: 20,
total: total
})
@smarchetti
smarchetti / writeObjToFile.js
Last active October 21, 2016 20:23
async method to write a JavaScript object to a file
const fs = require('fs')
/**
* writes the contents of an object to a file
* @param {object} obj the object to write
* @param {string} filePath the path of the file to write
* @return {Promise}
*/
const writeObjToFile = (obj, filePath) => new Promise((resolve, reject) => {
fs.writeFile(filePath, JSON.stringify(obj), (err, res) => {