Skip to content

Instantly share code, notes, and snippets.

View mardukbp's full-sized avatar

Marduk Bolaños mardukbp

View GitHub Profile
@mardukbp
mardukbp / django_preact.md
Created September 18, 2024 17:56 — forked from bennof/django_preact.md
Django with preact and bulma

Create a Project using Django, preact and bulma

Python setup

Init folders:

mkdir project_name
cd project_name
pipenv --shell
pipenv install django djangorestframework django_rest_knox
@mardukbp
mardukbp / data-modeling.md
Created November 10, 2024 16:50 — forked from levand/data-modeling.md
Advice about data modeling in Clojure

Since it has come up a few times, I thought I’d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.

Clojure is a data-oriented language: we’re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. It’s still possible to write “bad” data in Clojure.

“Good” data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and

@mardukbp
mardukbp / KeyboardSpeed.cmd
Created November 29, 2024 08:17 — forked from ygoe/KeyboardSpeed.cmd
Read and set keyboard delay and speed in Windows (requires new PowerShell because I was too lazy to write old C# code 😁)
<# :
@echo off & setlocal & set __args=%* & pwsh.exe -NoProfile -Command Invoke-Expression ('. { ' + (Get-Content -LiteralPath ""%~f0"" -Raw) + ' }' + $env:__args) & exit /b %ERRORLEVEL%
#> Add-Type @'
// ========== BEGIN C# CODE ==========
using System;
using System.Runtime.InteropServices;
public class Program
{
public static void Main(string[] args)
@mardukbp
mardukbp / building-sync-systems.md
Created December 14, 2024 13:46 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@mardukbp
mardukbp / FsCsInterop.md
Created May 14, 2025 07:13 — forked from swlaschin/FsCsInterop.md
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.