Skip to content

Instantly share code, notes, and snippets.

@erichiller
erichiller / grunt-hugo-lunrjs.md
Last active February 12, 2024 16:46 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search

Gist Description

How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Updated from original to allow for url page changes, more detailed install instructions.
See More at www.hiller.pro
Thanks to sebz for the initial writeup!

Requirements

Requires Nodejs

import fs = require('fs');
import sql = require('sql.js');
export class Security {
private db;
private history: dayRecord[];
constructor(
private symbol: string,
require('source-map-support').install({
environment: 'node'
});
/**
* eLog - displays calling line number & message & dumps vars as pretty json string
* @param {string} msg - string to display in log message
* @param {any} dispVars - any number of variables (ellipsis , aka Rest parameters) to dump
* {@link https://github.com/evanw/node-source-map-support usable by typescript node-source-map-support module}
@erichiller
erichiller / menu.tsx
Created July 29, 2016 05:39
menu.tsx; transpiled into commonjs & es6
import * as React from 'react';
import { NavPane, NavPaneItem, Text } from 'react-desktop/windows';
export class Menu extends React.Component<any, any> {
static defaultProps = {
color: '#cc7f29',
theme: 'light'
};
state: {
@erichiller
erichiller / profile.ps1
Last active March 10, 2024 11:39
powershell profile for cmder - revised to load module information from json file via jq.exe
# Stored here:
# https://gist.github.com/erichiller/ee1ad352f8a2dd97a1ed606faa43f87f
# Set the cursor to be at the end of the line when searching history. ie. ^ Up arrow
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
# Change character prefix for multiline commands
Set-PSReadLineOption -ContinuationPrompt ' '
# see possible options under "Tab Complete" here:
# ERIC - EDH - setup bash
# If not running interactively, don't do anything
# this keeps SCP (file transfer from throwing errors) -- stops here
case $- in
*i*) ;;
*) return;;
esac
# Prevent Loops
@erichiller
erichiller / package.json
Created April 30, 2017 01:21
relative-path-vscode moditication
{
"name": "copy-relative-path",
"displayName": "Copy Relative Path",
"description": "Copy Relative Path from a File",
"version": "0.0.1",
"publisher": "alexdima",
"engines": {
"vscode": "^1.4.0"
},
"categories": [
from logging import getLogger
from typing import List, Any, Dict
import random
from json import JSONDecoder, JSONEncoder
from collections import UserList
info = getLogger(__name__).info
debug = getLogger(__name__).debug
info = getLogger(__name__).info
warn = getLogger(__name__).warn
@erichiller
erichiller / .clang-format
Created April 6, 2019 16:35
EDH Clang Format file
# .clang-format
# Eric D. Hiller
# 2018 February 12
# reference:
# <http://clang.llvm.org/docs/ClangFormatStyleOptions.html>
# To convert to a Value: 'quoted' format
# which is required for https://zed0.co.uk/clang-format-configurator/
# use the regex search: \n(?=\n{1,2}[#A-Za-z])
# and replace with '\n
@erichiller
erichiller / dotnet-suggest-shim.ps1
Last active November 27, 2023 14:03
Bash Completions should go into `~/.bash_completion`
# dotnet suggest shell start
#$env:PATH+=":~/.dotnet/tools";
if (Get-Command "dotnet-suggest" -errorAction SilentlyContinue)
{
$availableToComplete = (dotnet-suggest list) | Out-String
$availableToCompleteArray = $availableToComplete.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries) | Where-Object { $_ -ne "dotnet" }
Register-ArgumentCompleter -Native -CommandName $availableToCompleteArray -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$fullpath = (Get-Command $commandAst.CommandElements[0]).Source