Skip to content

Instantly share code, notes, and snippets.

View jasondavis's full-sized avatar

Jason Davis jasondavis

View GitHub Profile
@alangrainger
alangrainger / Copy direct link to Gmail email.md
Last active April 12, 2025 17:28
Copy a direct link to a Gmail email to your clipboard
@Normal-Tangerine8609
Normal-Tangerine8609 / progress-circle.js
Last active November 3, 2024 19:32
This is a function that allows you to create simple circular progress bars for widgets. It creates the image of the progress circle using `WebView` and the canvas element. The image is then set to the background image of a stack with padding applied so you can put any widget element within the circle.
/*
* progressCircle(on: Stack or Widget, value: number, colour: string, background: string, size: number, barWidth: number) : Promise<Stack>
*
* PARAMS
* on - the stack or widget to add the progress circle to
* value - a number between 1 and 100 to be the circle percentage or a number between 0 and 1 to be the circle percentage
* colour - a HTML supported (hex, rgb, hsl) colour for the progress of the circle. Alternitively, it can be two HTML supported colours seperated by a hyphen (white-black) for the first colour to be active on light mode and second on dark mode
* background - a HTML supported (hex, rgb, hsl) colour for the unfilled progress of the circle. Alternitively, it can be two HTML supported colours seperated by a hyphen (white-black) for the first colour to be active on light mode and second on dark mode
* size - the size of the progress circle
* barWidth - the width of the circular progress bar
@karpathy
karpathy / stablediffusionwalk.py
Last active November 5, 2025 20:13
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@antiops
antiops / tiktok-download.ahk
Created July 31, 2022 10:32
AutoHotKey script to automatically download TikTok videos that are copied to your clipboard
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
; Requires yt-dlp
; You might need to change the '$HOME' and '$USERNAME' if they dont work
; $HOME = 'C:\Users\YourUsername'; $USERNAME is your windows username
ClipChanged(Type) {
If InStr(Clipboard, "https://www.tiktok.com/@")
Or InStr(Clipboard, "https://tiktok.com/@") {
@alangrainger
alangrainger / getGooglePhoto.js
Last active November 4, 2022 11:12
Insert a personal Google Photo into an Obsidian entry, either as a link, a remote image, or a locally stored thumbnail
<%*
// You can create any number of resolution options that you want to select from
const resolutions = [
{
name: 'Thumbnail', // A friendly name
res: [350, 250] // Width by height. The image will maintain aspect ratio
},
{
name: 'Large',
res: [1280, 720]
@rwmyers
rwmyers / RaindropTemplaterTemplate
Last active September 9, 2025 19:34
Raindrop / Obsidian Integration
<%*
let raindrop = tp.user.raindrop;
let collections = await raindrop.collections();
let collection = await tp.system.suggester((item) => item.title, collections);
let raindrops = await raindrop.raindrops(collection._id);
let drop = await tp.system.suggester((item) => item.title, raindrops);
drop = await raindrop.raindrop(drop._id);
let title = drop.title
let url = drop.link
@QuaCKeReD
QuaCKeReD / new note.md
Last active July 7, 2025 23:53
Templater based workflow for creating new notes - Reason: I was fed up of having to select 5 different combinations of metadata, some combinations of which were not valid

<%* tpOptionsList = await tp.file.include('[[noteYamlOptions]]') || '' tpOptions = tpOptionsList.split('\n') || ''

tpOptionChosen = await tp.system.suggester(tpOptions, tpOptions, false, "Select option") || ''

tpOptionChosenArea = tpOptionChosen.toString().split(',')[0] || '' tpOptionChosenCompany = tpOptionChosen.toString().split(',')[1] || '' tpOptionChosenClient = tpOptionChosen.toString().split(',')[2] || '' tpOptionChosenProject = tpOptionChosen.toString().split(',')[3] || ''

@G33kDude
G33kDude / EasyStreamDeck.ahk
Created March 12, 2022 19:20
Launch AutoHotkey code from a StreamDeck efficiently using GET requests
#NoEnv
#Persistent
SetBatchLines, -1
#Include <Socket>
/*
Launch AutoHotkey code from a StreamDeck efficiently using GET requests
@GitMurf
GitMurf / obsidian.templater.pane.send-to-next.js
Created January 8, 2022 04:07
Send the current active line of text or if text is selected, send the selection... to the pane next to the active one
<%*
//OPTIONS: TOP / BOTTOM
const whereToWrite = "TOP";
//OPTIONS: COPY / MOVE
const copyOrMove = "COPY";
//Find leaf next door
const thisLeaf = app.workspace.activeLeaf;
const thisFile = thisLeaf.view.file;
let leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "right");
if(!leafToUse){leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "left");}
@daeh
daeh / default-template.md
Last active May 6, 2022 04:30
obsidian-default-template
created assets tags
<% tp.date.now('YYYY-MM-DD') %>T<% tp.date.now('HH-mm') %>
<% tp.file.path(false).split('/').slice(0, -1).join('/') + '/_resources/' + tp.file.title + '.assets/' %>

<% tp.file.title %>

assets