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
#!/usr/bin/env bash
# Time-stamp: <2017-04-27 09:57:21 kmodi>
# Example of using getopt to parse command line options
# Limitation: All the options
# starting with - have to be listed in --options/--longoptions, else getopt will
# error out. So this cannot be used in wrapper scripts for other applications
# where you plan to pass on the non-wrapper-script options to that wrapped
# application.
#!/usr/bin/env bash
# Time-stamp: <2017-10-23 12:14:47 kmodi>
# Hugo build script.. for hugo version build after switching to Go dep.
# (v0.31-DEV+)
# Usage: ./ # Installs using origin/master
# ./ --rev v0.30.2
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 as a Hugo theme component.
View strfmt.rst

The most important functions and macros provided are:

  1. the format functions to render a single value as a string,
  2. the fmt macro to construct a string containing several formatted values
  3. the writefmt and printfmt family of macros to write a formatted string to a file and stdout, respectively
  4. the interp and $$ string interpolation macros to render expressions embedded in the string itself
kaushalmodi / emacs_module_sample__bug.c
Created Jun 28, 2018
Regression caused by vm support for ref types commit
View emacs_module_sample__bug.c
/* Generated by Nim Compiler v0.18.1 */
/* (c) 2018 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -I/home/kmodi/usr_local/apps/6/emacs/master/bin -std=gnu99 -fPIC -I/home/kmodi/stow/pkgs/nim/bad/lib -o /home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/misc/nim-emacs-module/test/nimcache/emacs_module_sample.o /home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/misc/nim-emacs-module/test/nimcache/emacs_module_sample.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#!/usr/bin/env bash
# Time-stamp: <2018-06-23 22:16:08 kmodi>
# Usage: ./ # Installs using upstream/devel
# ./ --rev v0.18.0
# ./ --rev upstream/master
set -euo pipefail #
View emacs-module.h
/* emacs-module.h - GNU Emacs module API.
Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
#!/usr/bin/env bash
# Time-stamp: <2018-05-11 15:59:07 kmodi>
# Script to stow packages from ${STOW_PKGS_ROOT} to ~/stowed
# Usage: (That's it; from any directory)
# This script uses the unofficial strict mode as explained in
# Also checks have been done with to have a level of
#!/usr/bin/env bash
# Time-stamp: <2017-05-18 08:18:01 kmodi>
# Usage: ./ # Installs using origin/devel
# ./ --rev v0.17.0
# ./ --rev origin/master
set -euo pipefail #
#!/usr/bin/env bash
# Time-stamp: <2017-04-21 17:44:04 kmodi>
# This script uses the unofficial strict mode as explained in
# Also checks have been done with to have a level of
# confidence that this script will be free of loopholes.. or is it? :)
You can’t perform that action at this time.