Skip to content

Instantly share code, notes, and snippets.

View duplaja's full-sized avatar

Dan D. duplaja

  • Central US
View GitHub Profile
@fazt
fazt / index.py
Created April 19, 2019 15:06
Python Simple Discord Bot
import discord
from discord.ext import commands
import datetime
from urllib import parse, request
import re
bot = commands.Bot(command_prefix='>', description="This is a Helper Bot")
@bot.command()
@felipeelia
felipeelia / fetch-from-wp-rest-api.php
Last active September 15, 2019 19:15
Given a WP REST API content list route, fetches all IDs, URLs, and Titles into a CSV file.
<?php
/**
* Usage example: `php -f fetch-from-wp-rest-api.php https://wordpress.org/support/wp-json/wp/v2/articles helphub-list`
*/
$first_page = file_get_contents( $argv[1] . '?per_page=100' );
$first_page_headers = parse_headers( $http_response_header );
$content = json_decode( $first_page, true );
for ( $i = 2; $i < $first_page_headers['X-WP-TotalPages']; $i++ ) {
@dedunumax
dedunumax / create_privatebin.py
Last active July 16, 2023 16:09
Sample program to create PrivateBin notes using Python 3. It might come handy in automation. Code is based on https://github.com/r4sas/PBinCLI repository. Thanks a lot @r4sas! https://github.com/dedunu/blog/blob/main/2020/2020-06-19-create-privatebin-using-python-3.md
"""
This script creates a PrivateBin using Python 3.
Code is based on https://github.com/r4sas/PBinCLI repository.
Thanks a lot @r4sas!
Below modules should be installed in the environment.
requests
base58
pycryptodome
"""
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active April 29, 2025 09:24
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@jniltinho
jniltinho / install-buildkit.sh
Last active April 28, 2025 07:51
Enable BuildKit Docker on Linux Dist, Debian, Ubuntu, Fedora
#!/bin/bash
#
# https://docs.docker.com/build/buildkit/
# https://github.com/docker/buildx/releases/
# https://github.com/docker/buildx
## docker builder prune --all
## docker buildx du --verbose
## For Ubuntu 24.04 try: sudo apt install docker-buildx
@crazydevman
crazydevman / sync.js.diff
Created December 10, 2023 20:08
Actual SimpleFIN Sync set account notes about sync status
diff --git a/sync.js b/sync.js
index 215f6b5..c8c42d4 100644
--- a/sync.js
+++ b/sync.js
@@ -1,5 +1,6 @@
const simpleFIN = require('./simpleFIN')
const api = require('@actual-app/api');
+const actualInjected = require('@actual-app/api/dist/injected')
let _accessKey
@psybers
psybers / package.json
Created April 6, 2024 02:24
Finds uncategorized transactions in Actual Budget and asks Chat GPT to suggest the category.
{
"dependencies": {
"@actual-app/api": "^6.7.0",
"dotenv": "^16.4.5",
"openai": "^4.33.0"
}
}
@psybers
psybers / apply-interest.js
Last active June 16, 2024 22:24
Automatically insert Actual Budget transactions for loan interest. Add "interestRate:0.xx interestDay:yy" to the account note, where 'yy' is the day of month to insert the transaction. Run `npm install` to install packages, then `node apply-interest.js` to run it (I run it in a daily cron).
require("dotenv").config();
const api = require('@actual-app/api');
const payeeName = process.env.IMPORTER_PAYEE_NAME || 'Loan Interest';
const url = process.env.ACTUAL_SERVER_URL || '';
const password = process.env.ACTUAL_SERVER_PASSWORD || '';
const sync_id = process.env.ACTUAL_SYNC_ID || '';
const cache = process.env.IMPORTER_CACHE_DIR || './cache';