Skip to content

Instantly share code, notes, and snippets.

Kaushal Modi kaushalmodi

Block or report user

Report or block kaushalmodi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kaushalmodi
kaushalmodi / debugprint.html
Last active Aug 26, 2018
Pretty printing Hugo variables for debug
View debugprint.html
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 Jan 16, 2018
Simple description list shortcode for use with the Hugo static site generator.
View description-list.html
{{ .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 Jul 15, 2019
How to make Hugo (0.20+) generate an Atom feed instead of RSS
View README.md

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:
@kwf
kwf / pretty-pragmata.el
Last active Sep 1, 2019
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.
View pretty-pragmata.el
;; PRETTIFY SYMBOLS (with Pragmata Pro)
(defun setup-pragmata-ligatures ()
(setq prettify-symbols-alist
(append prettify-symbols-alist
'(("!!" . ?)
("!=" . ?)
("!==" . ?)
("!≡" . ?)
("!≡≡" . ?)
("!>" . ?)
View linux-libertine-webfont.css
@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');
@lukas-h
lukas-h / license-badges.md
Last active Sep 14, 2019
Markdown License Badges for your Project
View license-badges.md

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

@davejamesmiller
davejamesmiller / detect-input-type.sh
Last active Jun 14, 2019
Detect pipe/file input in Bash / shell script
View detect-input-type.sh
# How to detect whether input is from keyboard, a file, or another process.
# Useful for writing a script that can read from standard input, or prompt the
# user for input if there is none.
# Source: http://www.linuxquestions.org/questions/linux-software-2/bash-scripting-pipe-input-to-script-vs.-1-570945/
if readlink /proc/$$/fd/0 | grep -q "^pipe:"; then
# Pipe input (echo abc | myscript)
elif file $( readlink /proc/$$/fd/0 ) | grep -q "character special"; then
# Terminal input (keyboard)
You can’t perform that action at this time.