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
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
def build_page_content
build_flash_messages
div :id => "active_admin_content", :class => (skip_sidebar? ? "without_sidebar" : "with_sidebar") do
build_sidebar unless skip_sidebar?
build_main_content_wrapper
end
end
@benwoodward
benwoodward / postgres_role.sh
Created March 1, 2013 18:47
Create a new role in postgres
createuser -s -U $USER