Skip to content

Instantly share code, notes, and snippets.

Avatar
⚠️
Cannot read property 'status' of undefined

Jonny Buchanan insin

⚠️
Cannot read property 'status' of undefined
View GitHub Profile
@insin
insin / followers.js
Created October 13, 2022 18:09
Run this while viewing someone's Twitter /following list to get the handles of everyone they follow
View followers.js
let $follows = document.querySelector('div[data-testid="primaryColumn"] section > h1 + div[aria-label] > div')
let handles = new Set()
let finishTimeout
let observer
function finish() {
if (finishTimeout) {
clearTimeout(finishTimeout)
}
finishTimeout = setTimeout(() => {
@insin
insin / main.dart
Last active May 3, 2022 11:59
Remote Control for VLC Configuration Guides
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.deepOrange,
),
home: Scaffold(
@insin
insin / userChrome.css
Last active August 11, 2021 09:26
Firefox 91 userChrome.css
View userChrome.css
/* Remove the gap to the left and right of the title tab bar */
#TabsToolbar hbox.titlebar-spacer[type="pre-tabs"],
#TabsToolbar hbox.titlebar-spacer[type="post-tabs"] {
display: none !important;
}
/* Remove the buttons on the right of the location bar */
#page-action-buttons {
display: none !important;
}
@insin
insin / package-changelog.js
Last active June 27, 2020 23:54
Generate changelog Markdown for pinned npm packages in a package.json diff
View package-changelog.js
/**
* Generates changelog Markdown for pinned npm packages in a package.json diff
*
* Usage: git diff package.json | node package-changelog.js
*/
let fs = require('fs')
let changes = fs.readFileSync(0, 'utf-8')
@insin
insin / repro.lua
Created April 23, 2020 17:56
Repro of obs.obs_sceneitem_group_enum_items() bug
View repro.lua
local obs = obslua
--- name of a scene item
local source_name = ''
--- get the name of the current scene
local function current_scene_name()
local source = obs.obs_frontend_get_current_scene()
local name = obs.obs_source_get_name(source)
obs.obs_source_release(source)
@insin
insin / package.ts
Created March 1, 2019 14:32
I done a Deno
View package.ts
import * as path from 'https://deno.land/x/fs/path.ts'
export { path }
@insin
insin / .babelrc-default
Last active July 14, 2018 13:32
babel-plugin-add-module-exports bug repro
View .babelrc-default
{
"presets": [
"@babel/env",
],
"plugins": [
"add-module-exports"
]
}
@insin
insin / checkLogins.js
Last active July 13, 2018 03:25
Check your saved Firefox logins against the Pwned Passwords API (run in Tools → Web Developer → Browser Console)
View checkLogins.js
function sha1(input) {
let converter = Components.classes['@mozilla.org/intl/scriptableunicodeconverter']
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter)
converter.charset = 'UTF-8'
let data = converter.convertToByteArray(input)
let ch = Components.classes['@mozilla.org/security/hash;1']
.createInstance(Components.interfaces.nsICryptoHash)
ch.init(ch.SHA1)
ch.update(data, data.length)
let hash = ch.finish(false)
@insin
insin / userChrome.css
Last active March 4, 2018 15:24
userChrome.css for some aspects of the Firefox >= 57 UI which can't be tweaked via regular config
View userChrome.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Remove the gap to the left of the title tab bar */
#TabsToolbar hbox.titlebar-placeholder[type="pre-tabs"] {
display: none !important;
}
/* Remove the buttons on the right of the location bar */
#page-action-buttons {
display: none !important;
@insin
insin / updatePasswords.js
Last active November 2, 2020 09:30
Mass update Firefox passwords (run in Tools → Web Developer → Browser Console) - https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox#Enabling_the_Browser_Toolbox
View updatePasswords.js
function updatePasswords() {
let oldPassword = prompt('Old password:')
if (!oldPassword) return
let loginManager = Components.classes['@mozilla.org/login-manager;1']
.getService(Components.interfaces.nsILoginManager)
let matchingLogins = loginManager.getAllLogins().filter(l => l.password === oldPassword)
let matchCount = matchingLogins.length
if (matchCount === 0) return alert('No matching logins found')