Skip to content

Instantly share code, notes, and snippets.

View zikani03's full-sized avatar
🏍️
Progress is intentional

Zikani Nyirenda Mwase zikani03

🏍️
Progress is intentional
View GitHub Profile
@adtac
adtac / Dockerfile
Last active November 1, 2024 03:05
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@zikani03
zikani03 / primevue.code-snippets
Created September 20, 2022 10:10
Primevue Utilities
{
// VS Code Snippers for PrimeVue components
// @author Zikani Nyirenda Mwase <[email protected]>
"p-inputtext": {
"scope": "vue,javascript,typescript,html",
"prefix": "pi:text",
"body": [
"<div class=\"field\">",
" <div class=\"p-float-label\">",
" <InputText id=\"$1\" v-model=\"$1\"/>",
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active November 17, 2024 14:27
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@zikani03
zikani03 / chremote.py
Last active September 15, 2021 19:45
chremote.py: Change https -> ssh remote urls for GitHub repos in a directory
#!/usr/bin/python
"""Changes remote urls for repositories in a given directory to SSH remotes
for repositories in a given directory. Since GitHub removed password based auth.
Run it using: `python chremote.py --d /path/to/directory`
Basic interaction is outlined below;
```
$ ls /path/to/directory
@Tostino
Tostino / uuid_time_nextval.sql
Created January 22, 2021 20:09
PL/PGSQL Function for uuid_time_nextval
CREATE FUNCTION uuid_time_nextval(interval_length int default 60, interval_count int default 65536)
RETURNS uuid
LANGUAGE plpgsql
AS $$
DECLARE
v_i int;
v_prefix_bytes int = 0;
v_time bigint;
v_bytes int[16] = '{}';
v_hex text[16] = '{}';
@scastiel
scastiel / Makefile
Last active July 4, 2023 12:00
Resources for eBook creating using Pandoc
all: pdf epub kindle html examples
BOOK_TITLE = A\ React\ Developer’s\ Guide\ to\ Hooks\ -\ Sebastien\ Castiel
dist:
@mkdir -p dist
pdf: dist/${BOOK_TITLE}.pdf
@echo '✅ PDF'
#!/bin/bash
# Recommended steps:
#
# bootstrap before entering chroot
# copy this script into INSTALL_DIR
# rootinit after entering chroot
# x (if installing graphics)
# pkgs
# xpkgs (if installing graphics)
@MakawaMT
MakawaMT / sms_regex_malawi.java
Created October 17, 2019 13:33
Contains regular expressions for SMSes returned when payment is done using the mobile money/bank providers. Regex can be tested at Regex planet https://www.regexplanet.com/ . The REGEX contains named groups which can help you extract particular information for that transaction which can be used for accountability and confirmation
/*
* Copyright (c) 2019 Lomaku Technologies.
* All Rights Reserved.
* 40 Estate Road, Angelo Goveya, Limbe.
* +265 999 388 747
* https://github.com/LomakuIT
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
@SharkFourSix
SharkFourSix / HttpsRedirector.java
Last active July 2, 2019 15:15
Spark Java HTTP to HTTPS redirector
import java.io.Closeable;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Set;
public final class HttpsRedirector {
@SharkFourSix
SharkFourSix / AntiXsrfCookie.java
Last active July 2, 2019 15:14
Anti-XSRF Cookies in Spark Java using 'SameSite' flag
import javax.servlet.http.Cookie;
import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public final class AntiXsrfCookie extends Cookie {
private static final String SAME_SITE_LAX = "Lax";
private static final String SAME_SITE_STRICT = "Strict";