Skip to content

Instantly share code, notes, and snippets.

@rmoorman
rmoorman / README.md
Last active April 15, 2024 18:54
A small Zod schema to Antd Form adapter

A small Zod schema to Antd Form adapter

Disclaimer

  • Might only work in Antd v4. I guess I will find out soon.
  • Don't add rules on the schema related Form.Item components.
  • Might not do everything you need (e.g. async?)
  • May have bugs. But what doesn't 🤣

What it does and how to use it

@rmoorman
rmoorman / openssl_commands.md
Created April 8, 2024 18:29 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
#!/usr/bin/env bash
DATABASE_URL="postgres://MyPostgresUser:MyPostgresPassword@192.168.0.1:5432/MyPostgresDB"
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups.
DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1)
DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1)
DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1)
DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1)
@rmoorman
rmoorman / .iex.exs
Created April 2, 2024 14:37 — forked from brainlid/.iex.exs
My .iex.exs file that lives in my Home directory. Gets loaded and used in every IEx session on my machines. I borrowed and stole all the great ideas from others an tweaked them over the years.
Application.put_env(:elixir, :ansi_enabled, true)
# IEx shell customization for color
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/
# - Can add to a specific project or can put in the User home folder as a global config.
# Updates from:
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs
timestamp = fn ->
{_date, {hour, minute, _second}} = :calendar.local_time
@rmoorman
rmoorman / apache_self_signed.sh
Created April 2, 2024 09:34 — forked from saissemet/apache_self_signed.sh
Apache website with self signed certificates
sudo apt update && sudo apt upgrade -y
sudo apt install apache2 -y
sudo apt install easy-rsa -y
cd /usr/share/easy-rsa
sudo ./easyrsa init-pki
yes "" | sudo ./easyrsa build-ca nopass
@rmoorman
rmoorman / 2serv.py
Created November 16, 2023 22:22 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@rmoorman
rmoorman / fluent-filebeat-comparison.md
Created November 6, 2023 14:28 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@rmoorman
rmoorman / normcore-llm.md
Created September 4, 2023 12:25 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@rmoorman
rmoorman / .pylintrc
Created October 26, 2022 21:03 — forked from joepreludian/.pylintrc
Pylint rc file template for django projects. Ignores migrations and test suites.
[MASTER]
profile=no
persistent=yes
ignore=tests.py, urls.py, migrations
cache-size=500
[MESSAGES CONTROL]
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
@rmoorman
rmoorman / update_primary_key.py
Created October 25, 2022 21:50
Management command to update a primary key and update all child-tables with a foreign key to this table. Updates primary key (and cascade to child tables); Django Version: 1.3
# -*- coding: utf-8 -*-
# code is in the public domain
# (c) 2012 Thomas Güttler http://www.thomas-guettler.de/
#
# http://djangosnippets.org/snippets/2691/
# myapp/management/commands/update_primary_key.py
u'''
Management command to update a primary key and update all child-tables with a foreign key to this table.