Skip to content

Instantly share code, notes, and snippets.

@pkrusche
pkrusche / jquery.staticsearch.js
Last active May 25, 2021 21:31
Static site search using RSS in JQuery
// Static site search using the RSS feed.
//
// Inspired by
// http://joevennix.com/2011/05/25/How-I-Implement-Static-Site-Search.html
//
// Extended to do match scoring by Peter Krusche
(function( $ ){
function htmlEscape(s) {
return $('<div/>').text(s).html();
@pkrusche
pkrusche / compile.sh
Last active July 17, 2022 12:34
A generic factory in C++
#!/bin/bash
CC=g++
${CC} -o if_test main.cpp interface.cpp interface_impl_1.cpp interface_impl_2.cpp
@pkrusche
pkrusche / versioning.py
Created November 8, 2013 10:37
Git version in Python
#!/usr/bin/env python
""" Git Versioning Script
Will transform stdin to expand some keywords with git version/author/date information.
Specify --clean to remove this information before commit.
Setup: