Skip to content

Instantly share code, notes, and snippets.

View treffynnon's full-sized avatar
🧟

Simon Holywell treffynnon

🧟
View GitHub Profile
<!-- In the HTML of your posts: Replace ID number with ID of your gist -->
<p class="embed_gist"><a href="http://gist.github.com/367154">http://gist.github.com/367154</a></p>
@treffynnon
treffynnon / ip_based_auth.php
Last active December 16, 2015 09:29
A simple PHP snippet to verify authorisation via IP address. Supports wildcard/partial IP addresses.
<?php
$allowable_ips = array(
'192.168.0.',
'8.8.8.8',
);
$is_allowed = (bool) array_filter($allowable_ips, function($value) {
return (substr($_SERVER['REMOTE_ADDR'], 0, strlen($value)) == $value);
});
@treffynnon
treffynnon / convert.php
Last active December 21, 2019 12:28
Pelican to Hugo reStructuredText post converter (Python static site generator to Go static site generator)
<?php
/**
* Requires pandoc to be installed and in your path
*
* It will look for .rst files in __DIR__/content/* where it will expect to find
* category folders. Inside these category folders your posts should be available.
*
* So
*
@treffynnon
treffynnon / SassMeister-input.scss
Created May 11, 2015 12:58
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
.search-doctors-box {
position:relative;
z-index:999;
margin: 0px;
&--at-map {
@treffynnon
treffynnon / manifest.xml
Created April 14, 2016 01:24 — forked from hugowan/manifest.xml
auspost maninfest xml
<?xml version="1.0" encoding="UTF-8"?>
<PCMS xmlns="http://www.auspost.com.au/xml/pcms">
<SendPCMSManifest>
<header>
<TransactionDateTime>2010>01-13T16:30:00.0Z</TransactionDateTime>
<TransactionId>1</TransactionId>
<TransactionSequence>1</TransactionSequence>
<ApplicationId>MERCHANT</ApplicationId>
</header>
<body>