Skip to content

Instantly share code, notes, and snippets.

View sweenzor's full-sized avatar

Matt Sweeney sweenzor

View GitHub Profile
@wiseman
wiseman / agent.py
Last active March 30, 2024 12:51
Langchain example: self-debugging
from io import StringIO
import sys
from typing import Dict, Optional
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents.tools import Tool
from langchain.llms import OpenAI
@canadaduane
canadaduane / Filter-NGPVAN-Political-Emails.md
Last active February 6, 2024 18:16
Move Incoming NGPVAN Political Emails in Gmail to Spam (Google Apps Script)
  1. Go to https://script.google.com
  2. Create a New Project
  3. Replace the Code.gs file it creates for you with the javascript below (copy/paste)
  4. Save the script
  5. Go to Triggers (looks like an alarm clock on left-hand side)
  6. Create a Trigger that acts every 10 minutes and calls filterNGPVANSpam
  7. You'll need to authorize this script to act on your behalf, which may require that you use the scary "Advanced" section to allow the script to read/write to your email inbox.
@jbnv
jbnv / roam.css
Last active July 29, 2023 20:22
Stylesheet for Roam Research
/* Based on original Dark Age theme by @shodty */
/* MAIN BODY AND BLOCK COLORS */
.roam-body-main {
margin-top: 45px;
border-radius: 12px;
background: var(--background);
margin-right: 6px;
margin-left: 9px;
@al45tair
al45tair / gist:73be245ab87a66a885742b98be91ac14
Last active April 10, 2024 09:00
Files installed by Zoom for mac OS

The Zoom install package for macOS is mad. Rather than actually using the installer to install things, it does everything in the preinstall script. That's bonkers, and also means that the system won't have a list of the files it installed, because it's doing it using shell script.

The script appears to install two items, namely:

/Applications/zoom.us.app
~/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin

If the user opening the package isn't an administrator, it looks like it will install the app in the user's home folder instead. If they are an administrator, Zoom will delete the ZoomUsPlugIn.plugin from /Library if it's there, but it still installs to ~/Library.

It also adds Zoom to your Dock automatically, without asking.

######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
# Like "git branch", but also show colorized (and aligned!) branch descriptions.
# Git branch descriptions can be created using "git branch --edit-description".
gb() {
maxlen=0
branches=$(git for-each-ref --format='%(refname)' refs/heads/ | sed 's|refs/heads/||')
for branch in $branches; do
len=${#branch}
if [ "$len" -gt "$maxlen" ]; then
maxlen="$len"
fi
@peteryates
peteryates / guide.md
Last active May 6, 2024 10:49
How to stop adverts appearing on your Samsung TV

I'm getting adverts in my TV's UI, help!

Samsung's otherwise excellent 2016 range of UHD TVs received an update that added advertisements to the UI. This has been complained about at great length on Samsung's forums and repeatedly, Samsung have refused to add an option to remove them.

The ads interrupt the clean UI of the TV and are invasive. Here's an example of how they look:

one two

This guide was originally posted on Samsung's TV forums but unfortunately, that site is a super-slow and barely accessible unusable mess.

@Moving-Electrons
Moving-Electrons / bear_to_pelican.py
Last active January 8, 2019 00:15
Python 3 script for exporting Bear App documents to Pelican Site Generator. The script takes a zip file (argument) containing the exported files in Markdown format from Bear App (i.e. MD file and images), reformats the MD adequately and moves the files to Pelican content folders. More information on www.movingelectrons.net
import sys
import re
import os
import zipfile
import shutil
# Constant Definition
# -------------------
# Path to be prepended to image links in markdown file, like so: ![](IMAGE_LINK<image_filename>).
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@nathan-osman
nathan-osman / win32.go
Last active May 14, 2024 14:18
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")