Skip to content

Instantly share code, notes, and snippets.

View benwoodward's full-sized avatar
💭
Working on spoken.app

Ben Woodward benwoodward

💭
Working on spoken.app
View GitHub Profile
@benwoodward
benwoodward / index.css
Created March 12, 2024 21:43
Arc Boost for Matter: Enlarge video player
.ednwsl8c {
max-width: 800px !important;
max-height: inherit !important;
}
@benwoodward
benwoodward / boost.js
Last active June 29, 2023 06:11
Arc Boost that clicks GPT4 button every time in ChatGPT, triggered by typing in prompt textarea (written by ChatGPT) - create a new boost, click the button to add code, paste this into the JS section
// Debounce function
function debounce(func, wait) {
let timeout;
return function() {
const context = this, args = arguments;
const later = function() {
timeout = null;
func.apply(context, args);
};
clearTimeout(timeout);
@benwoodward
benwoodward / extract-json.ts
Created April 13, 2023 02:14
Extract JSON array from LLM text
function matchBalancedBrackets(inputText) {
const matches = []
let stack = 0
let startIndex
for (let i = 0; i < inputText.length; i++) {
const char = inputText[i]
if (char === '[') {
if (stack === 0) {
startIndex = i
@benwoodward
benwoodward / shift-select-checkboxes.js
Created September 18, 2022 11:14
shift select logic for checkboxes
const checkboxes = document.querySelectorAll('.checkbox input[type="checkbox"]');
let lastChecked;
function handleCheck(e) {
let inBetween = false;
if(e.shiftKey && this.checked) {
checkboxes.forEach( checkbox => {
if(checkbox === this || checkbox === lastChecked) {
inBetween = !inBetween;
@benwoodward
benwoodward / new-files.sh
Created February 26, 2020 13:27
Mac/Zsh-only: List new files recursively by date created within current directory. Displays relative dates.
relative-date() {
while read input_string; do
local file_path=`echo $input_string | cut -d ' ' -f 5`
local ls_date=`echo $input_string | cut -d ' ' -f 1,2,3,4`
# Accepts date in format found in `ls` output, and converts to epoch
local date="$(date -j -f "%d %b %H:%M:%S %Y" "$ls_date" +"%s")"
local now="$(date +"%s")"
local time_diff=$((now - date))
if ((time_diff > 24*60*60)); then
@benwoodward
benwoodward / unclap.rb
Last active June 23, 2018 21:11
Script to unclap/unrecommend all stories on Medium
require 'rubygems'
require 'selenium-webdriver'
class Unclap
USERNAME = "@yourusername"
def initialize
@driver = Selenium::WebDriver.for :chrome
@links_to_unclap = []
@problem_links = []
@benwoodward
benwoodward / # macvim - 2016-04-19_09-57-26.txt
Created April 19, 2016 00:00
macvim on Mac OS X 10.11.3 - Homebrew build logs
Homebrew build logs for macvim on Mac OS X 10.11.3
Build date: 2016-04-19 09:57:26
@benwoodward
benwoodward / do_end.sublime-snippet
Created October 12, 2014 00:57
Sublime Text Snippet for simple "do ... end", because typing do+enter annoyingly activates the 'dob' (do |variable| .. end) snippet, which is not always what you want.
<snippet>
<content><![CDATA[do$do
$0
end]]></content>
<tabTrigger>do</tabTrigger>
<scope>source.ruby</scope>
<description>do … end</description>
</snippet>
@benwoodward
benwoodward / keybase.md
Created September 24, 2014 01:51
keybase.md

Keybase proof

I hereby claim:

  • I am benwoodward on github.
  • I am benwoodward (https://keybase.io/benwoodward) on keybase.
  • I have a public key whose fingerprint is 8CB4 B3A3 55DC D852 72E0 CF5B DC0B 197A B188 0BE3

To claim this, I am signing this object:

@benwoodward
benwoodward / haml_data-attributes.haml
Created August 12, 2014 13:45
How to convert html 5 data attributes in haml to html
%table.table.table-bordered.table-striped#sortable{:data => {update_url:
sort_admin_things_path}}