Skip to content

Instantly share code, notes, and snippets.

window.airbnbPostToSheet = (WEBHOOK) => {
if (!WEBHOOK) return alert('ERROR: WEBHOOK not set');
const $$ = sel => Array.from(document.querySelectorAll(sel) || []);
const $ = document.querySelector.bind(document);
$('.v7aged4')?.click(); // open amenities popup
setTimeout(() => {
const amenities = $$('._gw4xx4').map(x => x.textContent.trim().toLowerCase()).join(' ');
const city = $('._9xiloll')?.textContent?.split(', ') || ['—', '—'];
@smirea
smirea / machine.js
Last active January 23, 2020 15:57
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Keybase proof

I hereby claim:

  • I am smirea on github.
  • I am smirea (https://keybase.io/smirea) on keybase.
  • I have a public key whose fingerprint is 69EF A35D 4566 BEE2 B004 BB03 8A5A 6339 B5E8 A7C9

To claim this, I am signing this object:

@smirea
smirea / reindent.js
Created January 23, 2016 22:50
Re-indents given files to have 4 spaces of indentation
var fs = require('fs');
var path = require('path');
process.argv.slice(2).forEach(function (file) {
var content = fs.readFileSync(file).toString();
var indent = get_indentation(content);
if (isNaN(indent)) throw new Error('NaN:' + file);
if (!indent || indent === 4) {
console.log('Skip:', file);
// ==UserScript==
// @name Facebook Chat Enhancer
// @namespace http://code4fun.de
// @version 0.2
// @description Adds emoticon hotkeys + makes chat bigger
// @match https://www.facebook.com/*
// @copyright 2014+, Stefan Mirea
// ==/UserScript==
var KEYS = {CANCEL:3,HELP:6,BACK_SPACE:8,TAB:9,CLEAR:12,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINTSCREEN:44,INSERT:45,DELETE:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,SEMICOLON:59,EQUALS:61,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,COMMAND:91,CONTEXT_MENU:93,NUMPAD0:96,NUMPAD1:97,NUMPAD2:98,NUMPAD3:99,NUMPAD4:100,NUMPAD5:101,NUMPAD6:102,NUMPAD7:103,NUMPAD8:104,NUMPAD9:105,MULTIPLY:106,ADD:107,SEPARATOR:108,SUBTRACT:109,DECIMAL:110,DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124
@smirea
smirea / facebook-chat-enhancer.js
Created July 23, 2014 19:24
Facebook Chat Enhancer
// ==UserScript==
// @name Facebook Chat Enhancer
// @namespace http://code4fun.de
// @version 0.2
// @description Adds emoticon hotkeys + makes chat bigger
// @match https://www.facebook.com/*
// @copyright 2014+, Stefan Mirea
// ==/UserScript==
var KEYS = {CANCEL:3,HELP:6,BACK_SPACE:8,TAB:9,CLEAR:12,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINTSCREEN:44,INSERT:45,DELETE:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,SEMICOLON:59,EQUALS:61,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,COMMAND:91,CONTEXT_MENU:93,NUMPAD0:96,NUMPAD1:97,NUMPAD2:98,NUMPAD3:99,NUMPAD4:100,NUMPAD5:101,NUMPAD6:102,NUMPAD7:103,NUMPAD8:104,NUMPAD9:105,MULTIPLY:106,ADD:107,SEPARATOR:108,SUBTRACT:109,DECIMAL:110,DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124
@smirea
smirea / hgrc
Created July 16, 2013 17:24
Mercurial ~/.hgrc file - Makes working with mercurial slightly more pleasant, especially when working for Mozilla - base on Gregory Szorc's hgrc: http://gregoryszorc.com/blog/2013/05/12/thoughts-on-mercurial-(and-git)/
[ui]
username = Stefan Mirea <smirea@mozilla.org>
[extensions]
color =
graphlog =
histedit =
mq =
pager =
progress =
@smirea
smirea / Mozilla Bugzilla Comments Enhancer
Last active December 19, 2015 14:39
adds color coding to diff headers in Bugzilla, enables color coding of code blocks with hotkey navigation and more (check first comment)
// ==UserScript==
// @name Mozilla Bugzilla Comment Enhancer
// @namespace http://code4fun.de
// @description read the name
// @include https://bugzilla.mozilla.org/*
// @grant GM_addStyle
// @version 1
// ==/UserScript==
unsafeWindow.addEventListener ("load", init, false);
@smirea
smirea / Mozilla Try Enhancer
Last active December 19, 2015 14:39
adds a nice title to Mozilla Try pages with an overview of the running revision
// ==UserScript==
// @name Mozilla Try Enhancer
// @namespace http://code4fun.de
// @description adds a nice title to Mozilla Try pages with an overview of the running revision
// @include https://tbpl.mozilla.org/*
// @grant GM_addStyle
// @version 1
// ==/UserScript==
// normal chars: ✗ ↻ ✓ †
@smirea
smirea / Mozilla Try Log Enhancer
Last active December 19, 2015 14:39
Greasemonkey Firefox Script + Colorizes the logs + Displays screenshots inline
// ==UserScript==
// @name Mozilla Try Log Enhancer
// @namespace http://code4fun.de
// @include https://tbpl.mozilla.org/php/getParsedLog.php*
// @version 1
// ==/UserScript==
window.addEventListener ("load", init, false);
let match_screenshot = 'SCREENSHOT: ';