Skip to content

Instantly share code, notes, and snippets.

@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@denysvitali
denysvitali / sonos-play-music-from-live-yt-stream.md
Last active June 24, 2022 07:25
Play Music from Live YT Stream (Sonos)

Play Music from Youtube Live Stream

Requirements

Running

streamlink --hls-live-edge=`date "+%M*60/2+%S/2" | bc` https://www.youtube.com/watch\?v\=b3NtpSc5RNw best --stdout | ffmpeg -i pipe:0 -q:a 0 -map a -f mp3 pipe:1 | vlc -
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created June 2, 2017 02:35
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}

Jelly Beans Terminal Color Theme

https://ptpb.pw/qUwt.png

Terminal Colors

@graysky2
graysky2 / Xdefaults.jellybeans
Created November 24, 2016 15:49 — forked from pablox-cl/Xdefaults.jellybeans
Jellybeans color palette for rxvt and xfce4-terminal
# Adjust Rxvt to suit your terminal emulator
# Created with
# ITERM_COLOR_MULTIPLIER=2.5 ./itermcolors2Xdefaults.rb Jellybeans.itermcolors
# https://github.com/richo/jellybeans.vim/blob/c7ff7e9555881a5671fcc8753b381ba142b5ea82/Xdefaults/jellybeans.Xdefaults
Rxvt*color0: #393939
Rxvt*color1: #ca674a
Rxvt*color2: #96a967
Rxvt*color3: #d3a94a
Rxvt*color4: #5778c1
Rxvt*color5: #9c35ac
#cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results,
.cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left,
.cVim-completion-item .cVim-right {
/* font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial; */
font-family: "M+ 1m","Input","PragmataPro","Consolas","Incosoloata","TheMixMono","Monospace";
font-size: 10pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-command-bar {
@odewahn
odewahn / error-handling-with-fetch.md
Last active June 9, 2024 14:27
Processing errors with Fetch API

I really liked @tjvantoll article Handling Failed HTTP Responses With fetch(). The one thing I found annoying with it, though, is that response.statusText always returns the generic error message associated with the error code. Most APIs, however, will generally return some kind of useful, more human friendly message in the body.

Here's a modification that will capture this message. The key is that rather than throwing an error, you just throw the response and then process it in the catch block to extract the message in the body:

fetch("/api/foo")
  .then( response => {
    if (!response.ok) { throw response }
    return response.json()  //we only get here if there is no error
 })
@Avaq
Avaq / combinators.js
Last active July 15, 2024 14:46
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@Koushien
Koushien / ff-urlbar-search.md
Last active October 26, 2015 23:03
Quick reference on utilizing Firefox's urlbar search features.
names in about:config default key returns
browser.urlbar.match.title # match text in the title
browser.urlbar.match.url @ match text in the URL
browser.urlbar.restrict.bookmark * only from bookmarks
browser.urlbar.restrict.history ^ only from browser history
browser.urlbar.restrict.tag + only tagged results
browser.urlbar.restrict.typed ~ only typed results (explicitly entered by address)
browser.urlbar.restrict.openpage % only open tabs; sans current
@bnagy
bnagy / gpgmutt.md
Last active July 7, 2024 08:18
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service