Skip to content

Instantly share code, notes, and snippets.

for a bookmarklet:

javascript:(function()%7Blet%20a%20%3D%20document.getElementsByClassName(%22uXB7xe%22)%3Bfor%20(var%20i%3D0%3B%20i%3Ca.length%3B%20i%2B%2B)%7Bb%20%3D%20a.item(i)%3Bif%20(b.offsetWidth%20%3E%200%20%26%26%20b.offsetHeight%20%3E%200)%20%7Bif(!b.getAttribute(%22aria-label%22).includes(%22Google%20Drive%20Folder%22))%20%7Bconsole.log(%60%24%7Bi%7D%20%24%7Bb.getAttribute(%22aria-label%22)%7D%60)%3Bvar%20evt%20%3D%20new%20MouseEvent(%22click%22%2C%20%7Bbubbles%3A%20true%2Ccancelable%3A%20true%2Cview%3A%20window%7D)%3Bvar%20evt2%20%3D%20new%20MouseEvent(%22dblclick%22%2C%20%7Bbubbles%3A%20true%2Ccancelable%3A%20true%2Cview%3A%20window%7D)%3Bb.dispatchEvent(evt)%3Bb.dispatchEvent(evt2)%3B%7D%7D%7D%7D)()

source:

let a = document.getElementsByClassName("uXB7xe");
for (var i=0; i
@cardi
cardi / showlabels-efbox.tex
Created January 3, 2019 23:21
latex - enabling better readability of showlabels using efbox
\documentclass{report}
\usepackage{xcolor}
\usepackage{blindtext}
\pagestyle{empty}
%%% boxed showlabels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{efbox}
@cardi
cardi / read-mrt.go
Created August 26, 2016 04:06
iterating through all records of an mrt (routing) file with go-mrt
package main
import (
"log"
"os"
mrt "github.com/kaorimatz/go-mrt"
)
// basic bgp/mrt library: https://github.com/kaorimatz/go-mrt/
@cardi
cardi / lockscreen.m
Created April 23, 2016 22:15
os x lock screen
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
/*
lockscreen.m
to compile:
clang -framework Foundation lockscreen.m -o lockscreen
@cardi
cardi / amex.js
Created December 1, 2015 19:39
automatically add all card offers on american express website
// instructions:
// 1. log in to american express
// 2. open the developer console in chrome
// 3. run the script below (at your own risk)
//
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any