Skip to content

Instantly share code, notes, and snippets.

@wilwade
wilwade / Bookmarklets.md
Last active January 9, 2025 01:15
Various Bookmarklets

Bookmarklets

Addning a Bookmarklet

  • Add a New Bookmark:
    • Navigate to the bookmarks manager. In most browsers, this can be accessed by pressing Ctrl+Shift+O or by selecting 'Bookmarks' from the browser menu and then choosing 'Bookmark manager'.
    • Right-click in the bookmarks bar or the folder where you want to add the bookmarklet and select 'Add new bookmark' or 'Add page'.
  • Configure the Bookmark:
    • In the 'Name' field, enter a descriptive name for your bookmarklet to help you identify its function.
    • In the 'URL' field, paste the entire JavaScript code provided for the bookmarklet. It starts with javascript:.
  • Save the Bookmark: Click 'Save' or 'Done' to add the bookmarklet to your bookmarks bar or folder.
@wilwade
wilwade / apps.md
Created May 11, 2023 14:40
Apps I like to use

Mac

  • Tad for displaying tabular data
  • Beekeeper for sql
  • clocker for tz clocks
  • Rectangle for window placement
  • Amphetamine for stopping system sleeping
  • fork for git gui
  • fanny for fan issues
  • iTerm2 for terminal
@wilwade
wilwade / unwatchAll.js
Created April 18, 2019 13:04
Unwatch all apps from Fabric.io
// 1. (optional) Toggle autowatch new apps off: https://fabric.io/settings/notifications
// 2. Visit https://fabric.io/settings/apps and run this script
// 3. (optional) Search and watch only the apps you want
const unwatch = (id) => fetch("https://fabric.io/api/v3/account/notifications/projects/unwatch", {"credentials":"include","headers":{"accept":"application/json, text/javascript, */*; q=0.01","accept-language":"en-US,en;q=0.9","cache-control":"no-cache","content-type":"application/x-www-form-urlencoded; charset=UTF-8","pragma":"no-cache","x-csrf-token":document.querySelector('head > meta[name=csrf-token]').getAttribute('content'),"x-requested-with":"XMLHttpRequest"},"referrer":"https://fabric.io/settings/apps?page=1","referrerPolicy":"origin-when-cross-origin","body":"project_id=" + id,"method":"PUT","mode":"cors"});
const unWatchPage = () => Promise.all([...document.querySelectorAll('#l_settings > article > section > div > div > div.relative > table > tbody > tr > td:nth-child(1) > a')].map(el => unwa
@wilwade
wilwade / tennis.clj
Last active May 23, 2018 13:52
Small clojure setup for tennis style scoring
(ns quartzy.core)
(def start {
:game []
:set []
:match []})
(def settings {
:game [4 2]
:set [6 2]
@wilwade
wilwade / N.ex
Created October 18, 2017 13:32
N is a self-redefining module in Elixir for fun. Likely shouldn't actually use this, but it is a fun example of a lot of macro and AST manipulation in Elixir.
defmodule N do
def module_quoted_replacer do
quote do
fn(defs) ->
quote do
defmodule N do
def module_quoted_replacer do
quote do
:module_replace_module
end
@wilwade
wilwade / firefox-history.sqlite
Created April 22, 2017 16:00
Show recently visited sites from places.sqlite
SELECT datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;
@wilwade
wilwade / templates_to_def.ex
Created March 20, 2017 14:03
Elixir Macro to take Phoenix Templates and make them callable functions
defmodule TemplatesToDef do
@doc """
Converts all templates into callable functions
## Examples
View Module:
defmodule User do
use Phoenix.Template
require TemplatesToDef
TemplatesToDef.to_def @phoenix_root, @phoenix_pattern
@wilwade
wilwade / fix.sh
Last active April 24, 2017 12:53
Fix Everything in one bash command for macOS
#!/bin/bash
##
# A Collection of different fixes. I keep it at ~/bin/fix or have it in
# my path so I can just fix whatever is wrong with macOS in one command
##
## Fix the Camera "Camera is not available" "Camera is in use" Bug
sudo killall VDCAssistant
## Fix the Control Strip when it is missing buttons

Keybase proof

I hereby claim:

  • I am wilwade on github.
  • I am wilwade (https://keybase.io/wilwade) on keybase.
  • I have a public key whose fingerprint is C706 A92F EC9A F0FD D579 9C03 B0DC 69D3 12E8 125B

To claim this, I am signing this object:

@wilwade
wilwade / apache_error_watch
Last active August 29, 2015 13:55
Can be added to cron to email found fatal errors
#!/bin/bash
##
# This will watch the given apache log file for errors.
# Author: Wil Wade <wil@wilwade.com>
# License: MIT
# Requires: sendmail
##
## Config