Skip to content

Instantly share code, notes, and snippets.

@Juke34
Juke34 / guix.md
Last active October 19, 2024 11:30
Guix installation on Mac M2

How to install GUIX on M2 Mac computer

Downloading & installing UTM

You need to install the UTM virtual machine manager In your browser, go to mac.getutm.app, and click on the Download button.

Mount the downloaded UTM.dmg disk-image and drag the UTM app to the Applications folder. Next, launch the UTM app from your Mac’s local Applications folder. (Depending on your Mac’s security settings, you may get a confirmation dialog when you launch UTM for the first time. If such a dialog appears, choose Open.)

@rakeshopensource
rakeshopensource / TimeBasedOnetimePassword.java
Created September 22, 2023 10:22
The Time-Based One-Time Password (TOTP) algorithm stands as a prevalent technique for producing single-use codes, pivotal for two-factor authentication and enhancing security protocols. For a practical dive into its workings, I've written custom implementation in java.
package org.rakeshopensource.systemdesign;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.util.stream.IntStream;
public class TimeBasedOnetimePassword {

Install PostgreSQL on Windows by scoop

Follow the below steps to install the latest version of PostgreSQL on Windows by scoop package manager.

Install PostgreSQL

scoop install postgresql -g

Configure PostgreSQL as a Windows Service

@lifan0127
lifan0127 / paper-qa-zotero.py
Created March 8, 2023 02:53
Streamlining Literature Reviews with Paper QA and Zotero
import os
os.environ['OPENAI_API_KEY'] = '<Your OpenAI API Key>'
# See here on how to find your Zotero info: https://github.com/urschrei/pyzotero#quickstart
ZOTERO_USER_ID = '<Your Zotero User ID>'
ZOTERO_API_KEY = '<Your Zotero API Key>'
ZOTERO_COLLECTION_ID = '<Your Zotero Collection ID>'
question = 'What predictive models are used in materials discovery?'
# The following prompt instruction is injected to limit the number of keywords per query
name: Tweet water level
on:
schedule:
- cron: '30 14 * * *'
jobs:
tweet:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
@jackrusher
jackrusher / AAA-README.md
Created October 16, 2020 12:02
Clojure + FUSE

Meld

A minimal example of creating a (mostly) working FUSE filesystem using Clojure. NOTE: I have only tested this with OSX, and it assumes you have already installed libfuse.

Trying it out

Create an empty directory at /tmp/meld to serve as your mount point, put these files in a directory called meld, then:

@vedang
vedang / hey_notmuch!
Last active August 4, 2024 06:46
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@pyrmont
pyrmont / deps.edn
Last active March 10, 2025 23:39
Figwheel setup with Conjure
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.597"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.4"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:release {:main-opts ["-m" "figwheel.main" "-bo" "release"]}
@mikeananev
mikeananev / coder.clj
Last active April 8, 2024 19:38
Adaptive LZW compression on Clojure
(ns coder ;; org.rssys.lzw
(:require [clojure.java.io :as io])
(:import (java.io InputStream OutputStream)
(com.github.jinahya.bit.io StreamByteInput StreamByteOutput DefaultBitOutput DefaultBitInput)))
(def MAX-BITS-LENGTH 18)
(def EOF 256)
(defn lzw-encode-stream
[^InputStream in-stream ^OutputStream out-stream]
@howyay
howyay / Setting up Postfix on Debian.md
Last active April 13, 2025 13:55
A guide to set up a Postfix + Dovecot IMAP server with complete spf, dkim and dmarc support.

An ultimate guide to Postfix + Dovecot IMAP server with complete SPF, DKIM and DMARC support and additional instructions for a multi-domain setup

In this guide, domain.com will be your root domain and mail.domain.com will be the hostname of your mail server