Skip to content

Instantly share code, notes, and snippets.

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
[
{
"id": "c154697af277016d452b1bc815f5d1787fa2d694",
"thumbnail": "https://media.guim.co.uk/9fd1d41b23d3831ee8b918930cdd1bdc0c8045e1/0_0_2560_1536/500.jpg",
"title": "There is a wounded pigeon in the garden. Should I intervene?",
"url": "https://www.theguardian.com/lifeandstyle/2022/oct/15/there-is-a-wounded-pigeon-in-the-garden-should-i-intervene",
"words": "795",
"section": "Life and style",
"date": "2022-10-15T05:00:58Z",
"image": "https://media.guim.co.uk/9fd1d41b23d3831ee8b918930cdd1bdc0c8045e1/0_0_2560_1536/1000.jpg",
@stephenhandley
stephenhandley / exportQueue.js
Last active April 26, 2024 10:46
Rdio queue to json
var queue = [];
var $albums = $('.QueueList .Album');
for (var i = 0; i < $albums.length; i++) {
var $album = $($albums[i]);
var $title = $album.find('.album_title');
var $artist = $album.find('.artist_title');
queue.push({
title : $title.text(),
href : $title.attr('href'),
artist : $artist.text()
@oclockvn
oclockvn / dictionary.js
Created January 25, 2018 20:54
find a word contains letter
var source = ["the",
"of",
"and",
"to",
"a",
"in",
"for",
"is",
"on",
"that",
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active April 26, 2024 10:45
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
// Curious about ages for the 2019 tour divide.
// Text grabbed from https://bikepacking.com/bikes/tour-divide-rigs-2019/
// That website is the best, I didn't write any of this, they did, all credit to them.
// btw:
// average age: 44.782051282051285
// median age: 45
const originalStr = `
JOIN/SUPPORT
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 26, 2024 10:44
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@jaawerth
jaawerth / desc.md
Last active April 26, 2024 10:44
No Fun Tuesdays (replace En Eff Tee with random dictionary words)

Non-Funkadelic Toasters userscript

Because sometimes I don't want to see the word "Necromancy's Fiscal Tecumseh's."

Nonintervention Feline Targets-replacer

Not properly documenting this, but if you wanna use it...

I may or may not eventually get around to properly packaging this as a shareable userscript or extension, complete with preloaded replacement words and such, so to use it:

@politologu
politologu / javascript-from-fundamentals-to-functional-js-v2_frontend_masters.markdown
Last active April 26, 2024 10:43
JavaScript: From Fundamentals to Functional JS, v2_frontend_Masters