Skip to content

Instantly share code, notes, and snippets.

View kaushalmodi's full-sized avatar

Kaushal Modi kaushalmodi

View GitHub Profile
@Arty2
Arty2 / fixedsearch.js
Last active December 14, 2023 17:10 — forked from cmod/hugofastsearch.md
Super fast, client side search for Hugo.io with Fusejs.io
// static/scripts/fixedsearch/fixedsearch.js
/*--------------------------------------------------------------
fixedsearch — Super fast, client side search for Hugo.io with Fusejs.io
based on https://gist.github.com/cmod/5410eae147e4318164258742dd053993
--------------------------------------------------------------*/
if (typeof variable !== 'undefined') {
console.log('fixedsearch.js already loaded');
} else {
fixedsearch = function(){
@Vindaar
Vindaar / aNimKissFFT.org
Last active March 3, 2020 21:08
An example on how to use Kiss FFT in Nim

Another attempt of using kissFFT in Nim

I decided to look at what I did a couple of years ago with kiss FFT and Nim.

My original use case involved FADC (flash ADC; ADC with a sampling frequency of 1 GHz) events from my PhD work, which randomly contained a lot of noise (probably due to EMI).

The FADC has a cyclic register with 2560 elements. My idea was to

```
using ripgrep
rg -t nim --no-line-number --no-heading --no-filename --only-matching 'defined\(\w+\)' | sort | uniq | wc -l
363
```
rg -t nim --no-line-number --no-heading --no-filename --only-matching 'defined\(\w+\)' | sort | uniq
```

Git orphan branches & working trees

Creating an ophan branch

This command will create a branch with no parent (no commit history) on a repo.

git checkout --orphan <new-branch>

Managing working trees

Manage folders linked to others branches of your repo. Do not confuse them with git submodules which are links to different repositories.

@eddiewebb
eddiewebb / readme.md
Last active February 12, 2024 08:46
Hugo JS Searching with Fuse.js
@kaushalmodi
kaushalmodi / debugprint.html
Last active July 11, 2023 01:03
Pretty printing Hugo variables for debug
Thanks for stopping by.
This code has been moved to https://github.com/kaushalmodi/hugo-debugprint as a Hugo theme component.
@dmyates
dmyates / description-list.html
Last active September 4, 2023 09:43
Simple description list shortcode for use with the Hugo static site generator.
{{ .Get 0 | replaceRE "<ul>" "<dl>" .Inner | replaceRE "</ul>" "</dl>" | replaceRE "<li>" "<dt>" | replaceRE "(<dt>.*?): " "$1</dt><dd>" | replaceRE "</li>" "</dd>" | markdownify }}
@lpar
lpar / README.md
Last active January 29, 2023 14:09
How to make Hugo (0.20+) generate an Atom feed instead of RSS

The Hugo static site generator sadly still uses the obsolete and badly standardized RSS format.

Here's how to set it up to generate an Atom feed instead. Pretty much all feed readers which understand RSS also understand Atom, except iTunes, and Atom is a better format.

  1. Define an appropriate media type and corresponding output format in config.toml:
@plaidfinch
plaidfinch / pretty-pragmata.el
Last active July 15, 2021 01:56
Mappings for prettify-symbols-mode to enable Pragmata Pro's ligatures in Emacs. I've taken some slight liberties with the original ligature map, to suit my own tastes.
;; PRETTIFY SYMBOLS (with Pragmata Pro)
(defun setup-pragmata-ligatures ()
(setq prettify-symbols-alist
(append prettify-symbols-alist
'(("!!" . ?)
("!=" . ?)
("!==" . ?)
("!≡" . ?)
("!≡≡" . ?)
("!>" . ?)
@font-face {
font-family: 'Linux Libertine'; /* normal */
src: url('/static/fonts/linux-libertine/LinLibertine_R.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Linux Libertine'; /* italic */
src: url('/static/fonts/linux-libertine/LinLibertine_RI.woff') format('woff');