Skip to content

Instantly share code, notes, and snippets.

View sweoggy's full-sized avatar
:octocat:

Oscar Reimer sweoggy

:octocat:
View GitHub Profile
@cmod
cmod / hugofastsearch.md
Last active March 22, 2024 07:02 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

@philbot9
philbot9 / php-apcu-bc_on_ubuntu_16.04.md
Created August 12, 2016 15:57
Install php-acpu-bc on Ubuntu 16.04

The php-apcu-bc package provides a backwards compatibility layer from apcu -> apc, and is reuqired for some older PHP code bases (e.g. Yii 1). The package is not (yet) available in the Ubuntu 16.04 repos. To install it, use php-pear:

sudo apt-get install php-dev php-pear
sudo pecl install apcu_bc-beta

Then edit /etc/php/7.0/apache2/php.ini and add the following at the end of the file:

@dansimau
dansimau / gist:842415
Created February 24, 2011 16:41
Bash function for running a command, checking the return code, and re-trying it x times after y sleep seconds.
#
# "<cmd>" <retry times> <retry wait>
#
do_retry()
{
cmd="$1"
retry_times=$2
retry_wait=$3
c=0