Skip to content

Instantly share code, notes, and snippets.

View svandragt's full-sized avatar
💪
+11 −272,086

Sander van Dragt svandragt

💪
+11 −272,086
View GitHub Profile
@svandragt
svandragt / atom.xml
Last active August 29, 2015 14:00 — forked from stammy/index.xml
Generalized atom.xml to use with jekyll (validates)
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{ site.name }}</title>
<link type="application/atom+xml" href="{{ site.url }}/atom.xml" rel="self"/>
<link type="text/html" href="{{ site.url }}" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}/</id>
@svandragt
svandragt / gist:7713a901fdac7b24fe3b6adbd31f74a2
Created April 25, 2016 13:10 — forked from nternetinspired/gist:7482445
Load Disqus comments only on demand if you give a shit about page weight and your visitors. Even with no comments, i.e. an empty comment form, calling Disqus will load an extra 226Kb. If your page has comments this can be far higher. This Gist accompanies my blog post: http://internet-inspired.com/wrote/load-disqus-on-demand/
// Requires jQuery of course.
$(document).ready(function() {
$('.show-comments').on('click', function(){
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username.
// ajax request to load the disqus javascript
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
@svandragt
svandragt / github-webhook-deploy.php
Created July 29, 2016 10:10 — forked from frippz/github-webhook-deploy.php
Github webhook PHP script
<?php
try {
// Decode JSON data from Github
$payload = json_decode($_REQUEST['payload']);
}
catch(Exception $e) {
exit(0);
}
// Deploy live if push was on master branch