Skip to content

Instantly share code, notes, and snippets.

View srid's full-sized avatar
🌤️
a smoothly flowing moment of clear experiencing

Sridhar Ratnakumar srid

🌤️
a smoothly flowing moment of clear experiencing
View GitHub Profile
let
pkgs = import <nixpkgs> {};
pname = "zettlr";
version = "1.6.0";
in pkgs.appimageTools.wrapType2 rec {
name = "${pname}-${version}";
src = pkgs.fetchurl {
url = "https://github.com/Zettlr/Zettlr/releases/download/v${version}/Zettlr-${version}-x86_64.appimage";
sha256 = "0s6p8rs0ag6j3wvhm518hd80s48s3sk8n20s3mazj6xlvvhc6iy5";
};
@srid
srid / nix-miso-macos-catalina.md
Created May 14, 2020 20:29 — forked from Tehnix/nix-miso-macos-catalina.md
Getting Nix and Miso set up on macOS Catalina

Setting up Nix

Following this thread on getting Nix set up on macOS Catalina, there's a few steps involved (assuming you have no /nix folder):

  1. Set up nix folder: echo 'nix' | sudo tee -a /etc/synthetic.conf

  2. Reboot for it to take effect

  3. Create an APFS volume for Nix (might need to use a different diskX number, check diskutil list for more):

sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix

@srid
srid / migrate.py
Last active May 19, 2020 12:17 — forked from felko/migrate.py
Migrate neuron zettelkastens to the new hash ID format
#!/usr/bin/env python3.8
import re
import sys
import os
import uuid
from pathlib import Path
import glob
import time
import datetime

Keybase proof

I hereby claim:

  • I am srid on github.
  • I am srid (https://keybase.io/srid) on keybase.
  • I have a public key ASBgNuV-ZMh9ZFRXeUJw4VQ8I3oA5MEZtDWmGw8Xl5dVDAo

To claim this, I am signing this object:

@srid
srid / zerocarb-cult.md
Last active July 21, 2020 14:36
r/zerocarb moderation reports

Reports of misbehaviour by r/zerocarb moderators

These are only a subset of various reports of misbehaviour reported of the r/zerocarb moderators.

@srid
srid / FixedList.elm
Created November 17, 2016 15:08
Attempting fixed list in Elm
module FixedList exposing (..)
type Nil a = Nil
type Cons fa a = Cons a fa
type alias FixedList0 a = Nil a
type alias FixedList1 a = Cons (FixedList0 a) a
type alias FixedList2 a = Cons (FixedList1 a) a
fl1 : FixedList1 Int
@srid
srid / hakyll.md
Last active September 1, 2015 19:25

Using Hakyll with CircleCi and GitHub Pages

[Posted April 24, 2015; restored here for reference]

Today I switched this site from Jekyll to Hakyll, a Haskell library for generating static sites. It is still hosted in GitHub Pages, which only supports Jekyll. Therefore I had to find a Continuous Delivery service (CD) that will perform and connect the "missing piece," the stage that generates the HTML pages — in between a git push and pushing to GitHub pages. Here is how I did it.

The architecture

  1. For CD, we use CircleCI which hooks into the GitHub repo and monitors for any pushes. When a commit or more is pushed it will start the build per the configuration defined in cirle.yml in the repo. The first step runs cabal install which installs the Hakyll dependencies (including pandoc). This step takes a while — and the CircleCI UI provides excellent feedback on
@srid
srid / laundryCoins.hs
Last active August 29, 2015 14:20
laundryCoins.hs
#!/usr/bin/env runhaskell
module Main where
data Coin = Quarter | Loonie deriving (Eq, Show)
type Cents = Int
cents :: Coin -> Cents
cents Quarter = 25
cents Loonie = 100
@srid
srid / jekyll-serve.el
Last active August 29, 2015 14:14
Start local jekyll server (edited by Srid) - http://oremacs.com/2015/02/01/blogging-about-blogging/
(defun jekyll-serve ()
(interactive)
(let* ((default-directory
(if (string-match "_posts/$" default-directory)
(directory-parent default-directory)
default-directory))
(buffer (if (get-buffer "*jekyll*")
(switch-to-buffer "*jekyll*")
(ansi-term "/bin/bash" "jekyll")))
(proc (get-buffer-process buffer)))
@srid
srid / bash_prompt_sh
Last active August 29, 2015 14:01
stackato bash prompt
#!/bin/bash -e
redis_hostport=$(cat /s/etc/kato/redis_uri | cut -d"/" -f3)
redis_host=$(echo $redis_hostport | cut -d: -f1)
redis_port=$(echo $redis_hostport | cut -d: -f2)
redis_cli="redis-cli -h ${redis_host} -p ${redis_port}"
user=$(whoami)
endpoint=$(timeout 0.1 $redis_cli get cluster | json endpoint)
ipaddr=$(timeout 0.1 /sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')
roles=$(timeout 0.1 $redis_cli get node | json "[\"${ipaddr}\"]" | json roles | json -ak | paste -sd "," -)