Skip to content

Instantly share code, notes, and snippets.

View gfscott's full-sized avatar

Graham F. Scott gfscott

View GitHub Profile
@gfscott
gfscott / Better Wordpress excerpt link
Created March 29, 2011 18:30
Wordpress's default the_excerpt() function includes no link at the end, just [...]. This snippet adds a "Read More" permalink to the end of the excerpt.
@gfscott
gfscott / provincely.html
Last active December 15, 2015 04:08
HTML to use with Provincely symbol font
<ul class="provincely">
<li data-province="ab" class="ab">a</li>
<li data-province="bc" class="bc">b</li>
<li data-province="mb" class="mb">c</li>
<li data-province="nb" class="nb">d</li>
<li data-province="nl" class="nl">e</li>
<li data-province="ns" class="ns">f</li>
<li data-province="nt" class="nt">g</li>
<li data-province="nu" class="nu">h</li>
<li data-province="on" class="on">i</li>
@gfscott
gfscott / provincely-css.html
Last active December 15, 2015 04:09
HTML to include Provincely CSS in your project
<link rel="stylesheet" href="provincely.css">
<!-- Note: double-check @import paths for font files -->
@gfscott
gfscott / nginx.conf
Last active August 29, 2015 14:08 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@gfscott
gfscott / wordpress-embed-soundcloud-mini-player.php
Last active February 14, 2023 14:21
Wordpress function to switch auto-embed Soundcloud player from large "visual" version to "mini"
<?php
/////////////////////////////////////////////////////////////////////////////////////
// Ask Wordpress to Embed Soundcloud’s Mini Player Instead of the Large Visual Player
/////////////////////////////////////////////////////////////////////////////////////
// Add function to theme’s functions.php file
// Relevant documentation:
// https://wordpress.org/support/topic/hookfilter-for-auto-embed-function-of-wp
// https://wordpress.org/support/topic/filter-hook-for-built-in-oembed-providers-eg-youtube
// https://developers.soundcloud.com/docs/oembed
function html5_figure_image( $html, $id, $caption, $title, $align, $url )
{
$html5 = "<figure id='post-$id media-$id' class='align-$align'>";
$html5 .= "<img src='$url' alt='$title' />";
if ($caption) {
$html5 .= "<figcaption>$caption</figcaption>";
}
$html5 .= "</figure>";
@gfscott
gfscott / related-creator.html
Last active March 16, 2017 21:09
Related Link Creator
@gfscott
gfscott / getJson.js
Created June 17, 2016 19:59
A simple, reusable AJAX helper function for GETting JSON
// -----------------------------------------------------------------------------
// SIMPLE REUSABLE AJAX GET JSON FUNCTION
// A frequent thing I find myself writing in projects is a simple function to
// get JSON via AJAX. This simple helper does that in a sensible way without
// needing jQuery or a needlessly complex standalone Ajax library. Get data
// so you can do stuff with it. That’s all it does. No POSTing, no crazy edge-
// case error handling.
function getJson(url, callback) {

Keybase proof

I hereby claim:

  • I am gfscott on github.
  • I am gfscott (https://keybase.io/gfscott) on keybase.
  • I have a public key whose fingerprint is 235C DC32 D0D8 DED1 69FC 0762 2752 D0A7 179C 6306

To claim this, I am signing this object:

@gfscott
gfscott / related-list-creator.html
Last active March 7, 2017 00:33
Create a list of related links to go at the end of a story on CanadianBusiness.com