Skip to content

Instantly share code, notes, and snippets.

View duplaja's full-sized avatar

Dan D. duplaja

  • Central US
View GitHub Profile
@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';
@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"
}
}
@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
@jniltinho
jniltinho / install-buildkit.sh
Last active March 19, 2025 19:16
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
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active March 17, 2025 17:41
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.

@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
"""
@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++ ) {
@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()
@rinogo
rinogo / UsHolidays.php
Created November 26, 2018 16:45
Simple unit-tested class to calculate federal holiday dates for the United States. Methods are included for determining if a date (timestamp) is considered a date and for accessing holidays by name and by timestamp.
<?php
//Adapted by rich at byu.net from https://www.damia.no/calculating-u-s-federal-holidays-with-php/
class UsHolidays {
private $year;
private $list;
const ONE_DAY = 86400; //Number of seconds in one day
@spivurno
spivurno / gp-copy-cat-copy-other-radio-button.html
Created January 26, 2018 14:44
Gravity Perks // GP Copy Cat // Copy Other Radio Button
<script>
/**
* Gravity Perks // GP Copy Cat // Copy Other Radio Button
* http://gravitywiz.com/documentation/gravity-forms-copy-cat/
*/
gform.addFilter( 'gppc_copied_value', function( value, $targetElem, field ) {
if( $targetElem.attr( 'id' ).split( '_' ).pop() == 'other' ) {
value = jQuery( '#input_' + field.sourceFormId + '_' + field.source + '_other' ).val();
}
return value;