Skip to content

Instantly share code, notes, and snippets.

View dragstor's full-sized avatar
👨‍🚀
Working on new projects 🛠

Nikola dragstor

👨‍🚀
Working on new projects 🛠
View GitHub Profile
@orneryd
orneryd / claudette-agent.installation.md
Last active March 22, 2026 14:36
Claudette coding agent (System Prompt, Preamble, Chatmode, etc…) built especially for free-tier models like chatGPT-3/4/5+ to behave more similar to Claude. Claudette-auto.md is the most structured and focuses on autonomy. *Condensed* nearly the same but smaller token cost for smaller contexts, *Compact* is for mini contexts. Memories file suppo…
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@richardARPANET
richardARPANET / round_to_attractive_price.py
Created September 10, 2020 15:11
For product pricing. Round to 'attractive' prices which don't scare off customers, e.g. 10.99, 10.50, 10.00, 9.95, etc.
from decimal import Decimal
def round_to_attractive_price(
value, attractive_after_decimals=(0, 50, 95, 99)
):
rounded = round(Decimal(value), 2)
before_decimal, after_decimal = str(rounded).split('.')
after_decimal = min(
attractive_after_decimals,
@johnnypea
johnnypea / useful-one-liners.sh
Last active February 20, 2026 16:14
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
*@0-180.com
*@0-420.com
*@0-900.com
*@0-aa.com
*@0-mail.com
*@0-z.xyz
*@00-mail.com
*@000476.com
*@000invaliddomain.local
*@001.igg.biz
@haseebq
haseebq / paddle_hook_verify.go
Last active January 25, 2023 09:43
Golang code to verify Paddle's webhook signature
package main
import (
"fmt"
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"encoding/pem"
@mholt
mholt / macapp.go
Last active March 6, 2026 15:42
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@KyNorthstar
KyNorthstar / NSWindow+Fade.swift
Last active April 7, 2025 22:28 — forked from indragiek/NSWindow+Fade.h
NSWindow+Fade - Animator proxy based NSWindow fading
//
// NSWindow+Fade.swift
// BH Bezel Notification
//
// Created by Ben Leggiero on 2017-11-09.
// Translated to Swift 4 from the original (ObjC): https://gist.github.com/indragiek/1397050
// Copyright © 2017 Ben Leggiero. All rights reserved.
//
import Foundation
@EmmanuelGuther
EmmanuelGuther / KOTLINExampleFragmentOnClickFragment.kt
Created October 21, 2017 19:14
An example to how implements a button Onclick in Kotlin - Android Fragment
class ExmpleFragment : Fragment(), View.OnClickListener {
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view: View = inflater!!.inflate(R.layout.fragment, container, false)
val btn: Button = view.find(R.id.button2)
btn.setOnClickListener(this)
return view
}
@grakic
grakic / ePorezi-macOS.md
Last active December 22, 2025 21:37
ePorezi na macOS

ePorezi na macOS

Zvanična klijentska aplikacija Poreske uprave se može preuzeti sa njihove stranice.

U pitanju je Java aplikacija koja dolazi sa posebno priređenom distribucijom Oracle Java radnog okruženja. Aplikacija podržava samo Microsoft Windows operativni sistem i sertifikatima u Personals skladištu pristupa kroz Microsoft CryptoAPI koji poziva operacije na pametnoj kartici ili tokenu posredstvom midlvera.

Sertifikaciono telo Pošte korisnicima nudi SafeSign midlver, osim u verziji za Windows i u verziji za GNU/Linux i macOS operativne sisteme. Midlver isporučuje prateću aplikaciju za upravljanje karticom/tokenom i PKCS#11 biblioteku. Programi poput jSignPDF, Adobe Reader ili LibreOffice mogu da učitaju ovu biblioteku i omoguće korisniku elektronsko potpisivanje dokumenata.

Elektronsko potpisivanje se koristi i na portalu ePorezi Poreske uprave, posredstvom pomenute klijentske aplikacije.