Skip to content

Instantly share code, notes, and snippets.

@eramdam
eramdam / .skhdrc
Created November 17, 2020 15:38
yabai/skhd config
#!/usr/bin/env sh
:: default : yabai -m config active_window_opacity 1; yabai -m config normal_window_opacity 1;
# Focus
shift + alt - home : yabai -m window --focus north
shift + alt - j : yabai -m window --focus north
shift + alt - end : yabai -m window --focus south
shift + alt - k : yabai -m window --focus south
shift + alt - delete : yabai -m window --focus west
@eramdam
eramdam / 01-browser.js
Last active April 8, 2024 06:00
Downloading FB stickers
// Open facebook.com/messages and the stickers pop-up, click on a Facebook Sticker set, open up your JS console and paste this
function dumpStickers() {
URLs = [];
URLs.push(document.querySelectorAll('._5r8a._5r8b')[0].getAttribute('aria-label'));
[].slice.call(document.querySelectorAll('._5r8h')).forEach(function (el) {
URLs.push(el.querySelector('div').style.backgroundImage.replace('url(','').replace(')','').replace('p64','p128').replace('x64','x128'));
});
return URLs;
}
copy(dumpStickers());
// ==UserScript==
// @name Click header to scroll to the top
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author Damien Erambert (Eramdam)
// @match https://cohost.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=cohost.org
// @grant none
// ==/UserScript==
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eramdam
eramdam / obsidian-web-clipper.js
Created January 16, 2022 00:31 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
[
{
"min": 126,
"max": 132,
"value": 1
},
{
"min": 132,
"max": 138,
"value": 2
.stream-item, .tweet-detail-reply .stream-item, .compose-header {
border-bottom: 0 !important;
}
.in-tweet-divider::before {
background: rgba(0, 0, 0, 0.13);
}
// ==UserScript==
// @name Screenshot Twitch
// @match *://*.twitch.tv/*
// @grant none
// @version 1.0
// @author @Eramdam
// @description 5/3/2020, 1:03:26 PM
// @require https://unpkg.com/file-saver@2.0.2/dist/FileSaver.min.js
// ==/UserScript==
@eramdam
eramdam / index.js
Created August 12, 2018 20:02
A small script to unfollow non-mutuals on Mastodon (useful if you need to do some cleaning)
const Masto = require('mastodon');
const fs = require('fs')
const M = new Masto({
access_token: 'ACCESS_TOKEN',
api_url: 'https://YOUR-INSTANCE.TLD/api/v1/'
});
function getNextPage(req) {
return (req.headers && req.headers.link && req.headers.link.includes('rel="next"')) ? req.headers.link.split(/<([^>]+)>/)[1] : null;