Skip to content

Instantly share code, notes, and snippets.

"""
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
import re
import util
@jakesylvestre
jakesylvestre / keepgoing.php
Last active August 29, 2015 14:20
Execute PHP after sending back the page
<?php
ob_end_clean();
header("Connection: close");
ignore_user_abort(true); // optional
ob_start();
echo ('Text the user will see');
$size = ob_get_length();
header("Content-Length: $size");
ob_end_flush(); // Strange behaviour, will not work
flush(); // Unless both are called !
(function() {
window.onload = function() {
var a = window.location.hash.substring(1);
10 < a.length && d("affiliate", a, 2);
e("copy-link-button1");
e("copy-link-button2");
document.getElementById("modal-close").onclick = function(a) {
a.preventDefault();
document.getElementById("share-modal").style.display = "none"
};
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank>1</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
@jakesylvestre
jakesylvestre / yum.sh
Created July 10, 2015 19:19
Installing Node on AMI
sudo yum install nodejs npm --enablerepo=epel