Skip to content

Instantly share code, notes, and snippets.

Avatar
💫

Jon Heslop jonheslop

💫
View GitHub Profile
@cmod
cmod / hugofastsearch.md
Last active Nov 29, 2021 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
View hugofastsearch.md

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

@robinsloan
robinsloan / unfave.rb
Last active Sep 6, 2021
Unfave script, because why not??
View unfave.rb
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@adactio
adactio / basicServiceWorker.js
Last active Jun 28, 2021
A basic Service Worker, for use on, say, a blog.
View basicServiceWorker.js
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
@joyrexus
joyrexus / README.md
Last active Nov 25, 2021 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
anonymous
anonymous / gist:4266129
Created Dec 12, 2012
Awesome placeholder attribute fallback
View gist:4266129
# If browser doesn't support placeholders, take the placeholder text and set it as the field's value
unless Modernizr.input.placeholder
$("input[placeholder]").each (index, element)->
$(element).val($(element).attr("placeholder"))
@robinsloan
robinsloan / langoliers.rb
Last active Sep 17, 2021
The Langoliers, a tweet deletion script
View langoliers.rb
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@mhulse
mhulse / Amazon S3 snippets and Transmit FTP cloud settings.md
Last active Feb 21, 2021
Amazon S3 snippets... Transmit FTP cloud settings... Other related goodies...
View Amazon S3 snippets and Transmit FTP cloud settings.md

S3 Website "Index Document"

index.html:

<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
@erikh
erikh / hack.sh
Created Mar 31, 2012 — forked from DAddYE/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@helen
helen / repeatable-fields-metabox.php
Created Jan 11, 2012
Repeating Custom Fields in a Metabox
View repeatable-fields-metabox.php
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {