Skip to content

Instantly share code, notes, and snippets.

View splorp's full-sized avatar
🎧

Grant Hutchinson splorp

🎧
View GitHub Profile
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@good
good / article.text.php
Created March 20, 2014 17:02
Custom meta description based on page content for Kirby
<?php snippet('header', array('section' => 'journal', 'title' => $page->title(), 'customdesc' => $page->text())); ?>
@stuntbox
stuntbox / gist:4557917
Last active March 23, 2023 03:32
Slightly smarter filtering to remove hard-coded width and height attributes from *all* images in WordPress (post thumbnails, images inserted into posts, and gravatars). Handy for responsive designs. Add the code below to the functions.php file in your theme's folder (/wp-content/themes/theme-name/ ). Remember to rename the function as needed to …
/**
* Filter out hard-coded width, height attributes on all images in WordPress.
* https://gist.github.com/4557917
*
* This version applies the function as a filter to the_content rather than send_to_editor.
* Changes made by filtering send_to_editor will be lost if you update the image or associated post
* and you will slowly lose your grip on sanity if you don't know to keep an eye out for it.
* the_content applies to the content of a post after it is retrieved from the database and is "theme-safe".
* (i.e., Your changes will not be stored permanently or impact the HTML output in other themes.)
*
@morgant
morgant / mirror_homepage.mac.com_sites_instructions.txt
Created June 18, 2012 18:23
Notes/instructions for how I've been mirroring homepage.mac.com sites to mirrors.unna.org
Mirroring homepage.mac.com sites to mirrors.unna.org:
1) Use `wget` to pull down a copy of the site. If pulling down a single file & all its prerequisites, use the following:
/usr/local/bin/wget -p --mirror -k -t 30 -w 5 -e robots=off -o homepage.mac.com-splorp.$(date +%Y-%m-%d-%H%M).log "http://homepage.mac.com/splorp/PhotoAlbum3.html" &
Alternatively, if pulling down an entire directory, use the following (Note: _make sure_ you include the trailing slash on the directory name!):
/usr/local/bin/wget --mirror -k -t 30 -w 5 -e robots=off -o homepage.mac.com-splorp.$(date +%Y-%m-%d-%H%M).log "http://homepage.mac.com/splorp/" &
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@kylefox
kylefox / haircut.py
Created October 29, 2010 18:43
Test
# test
# A script to calculate some basic stats on Grant Hutchinson's haircuts.
# See http://splorp.com/about/haircut/
#
# Sample output:
# Number of haircuts since December 22, 1998: 53
# Average days between haircuts: 77
# Shortest time between haircuts was April 10, 1999 to May 25, 1999 (45 days)
# Longest time between haircuts was August 11, 2007 to December 09, 2007 (120 days)
# You'll probably want a haircut in about 63 days (March 08, 2010)
#!/usr/bin/env perl
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs
# License: See below.
# http://gist.github.com/507356
use strict;
use warnings;
use URI::Escape;