Skip to content

Instantly share code, notes, and snippets.

View andrewmcodes's full-sized avatar
🎙️
Recording Remote Ruby

Andrew Mason andrewmcodes

🎙️
Recording Remote Ruby
View GitHub Profile
@MiroslavCsonka
MiroslavCsonka / terminal.sh
Last active March 26, 2025 17:07
Github Action with `gh signoff`
git add xyz.rb
git commit -m "A meaningful change"
# NOTE: The job has a 5-second waiting period since there's a delay between pushing and creating a new "signoff" GitHub check status.
git push && gh signoff

Debugging questions for entrepreneurs, creators and high performers

Do solo or with someone.

When you’re going through these prompts, ask people at the beginning to write down anything that’s currently on their mind and might distract them and put it aside mentally. Between every prompt, shake out or get up briefly.

Hamming Prompts

  • What's your top 3 most harmful habits? When your monkey brain takes over your rational brain?
  • What keep you stuck in this local maxima ?
@navjeetc
navjeetc / run_assistant.rb
Last active December 16, 2023 12:00
OpenAI assistants API usage
require 'openai'
client = OpenAI::Client.new(access_token: ENV['openai_key'])
assistants = OpenAI::Assistants.new(client: client)
# assistant = assistants.create(
# parameters: {
# name: 'Math tutor',
# model: 'gpt-4',
# instructions: 'You are a personal math tutor. Write and run code to answer math questions.'
@Fevol
Fevol / debugging.md
Last active April 1, 2025 02:04
An overview for debugging and performance analysis within Obsidian

Debugging your code

Unwinding the code trace

Sometimes you want to figure out what path your code takes when getting executed. This may be helpful for investigating inconsistent behaviour between function calls or finding where exactly in the bundled/minified code your function is located

// Logs the current stack trace of the code, also logs any provided parameters

/*
 * YOUR CODE HERE
 */
console.trace(var1, var2);
@louis030195
louis030195 / package.json
Last active February 1, 2025 08:20
A 100% local and typescript LLM in Apple Shortcut to be used everywhere on your computer in <1 second
{
"dependencies": {
"@llama-node/llama-cpp": "^0.0.32",
"llama-node": "^0.0.32"
},
"devDependencies": {
"@types/node": "^18.16.3"
}
}
#!/Users/aaron/.rubies/arm64/ruby-trunk/bin/ruby
# This is a demo language server for Ruby, written in Ruby. It just checks
# the syntax of Ruby programs when you save them.
#
# Configure this in Vim by adding the vim-lsp plugin, then doing this
# in your vimrc:
#
# au User lsp_setup
# \ lsp#register_server({
@Quorafind
Quorafind / AskChatGPT-With-Surfing.js
Created February 19, 2023 11:20
Using Quickadd to ask current selection In ChatGPT
// Version 0.0.1
module.exports = askChatWithPrompt;
function askChat(str, app) {
const prompt = encodeURI(str);
const chatViewEl = app.workspace.getLeavesOfType("surfing-view").find((item)=>{ return /chat\.openai\.com/.test(item?.view?.currentUrl)}).view.webviewEl;
chatViewEl.executeJavaScript(`
var htmlElement = document.querySelector("textarea");
htmlElement.value = decodeURI("${ prompt }");
@jgeusebroek
jgeusebroek / readwise_obsidian_export.md
Created December 29, 2022 20:40
Readwise Obsidian export templates

File name

{{last_highlighted_date |date('Y-m-d')}} {{title|replace(""","")|replace(""","")|replace("'","")|replace("'","")|truncate(159)}} by {{author|replace("@","")|truncate(80)}}

Add date and sanitize filename.

Page Metadata

{% if image_url -%}
![rw-book-cover]({{image_url}})
@ransurf
ransurf / Zettelizer.js
Created November 29, 2022 08:42
Eleanor's Zettelizer script but modified for my workflow
module.exports = async (params) => {
console.log("Starting...")
console.log(params);
const currentFile = params.app.workspace.getActiveFile();
if (!currentFile) {
new Notice("No active file.");
return;
}
console.log("Found active file: ", currentFile.basename);
@AnubisNekhet
AnubisNekhet / !Description.md
Last active May 15, 2023 04:19
Capacities-like sidebars

Preview

image

Caveats

Since the snippet utilises callouts, the sidebar disappears after a note is scrolled enough for the callout to be outside rendering range, i.e. it's best used for smaller notes. Smaller sidebar sizes are better in this case because there's more scroll area.

Usage

Use the capacities-sidebars.css as a snippet and paste the markdown into a new note.