This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
# Set up a rule for the Apple site association. | |
RewriteRule ^apple\-app\-site\-association$ /apple-app-site-association.php [L] | |
# If an existing asset or directory is requested go to it as it is | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d | |
RewriteCond %{REQUEST_URI} !^(bower_components|assets|apple\-app\-site\-association) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function contrast_colour(hex) { | |
//- Get rid of any hashes. | |
var colour = hex.replace(/\#/g, "") | |
//- Get the luminance. | |
var R = parseInt(colour.substring(0, 2), 16) | |
var G = parseInt(colour.substring(2, 4), 16) | |
var B = parseInt(colour.substring(4, 6), 16) | |
// If it's over half the total of 765 (255 * 3), it's lighter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// All the transform types. | |
const types = [ | |
"translate", | |
"translateX", | |
"translateY", | |
"scale", | |
"scaleX", | |
"scaleY", | |
"rotate", | |
"skew", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const notifications = models.notifications | |
notifications | |
.find({whatever}) | |
.exec((err, notifs) => { | |
notifications.destroy({whatever}) | |
// ^- Notifications here is undefined because this block has a definition of notifications later. | |
// It is dereferenced from this local scope pending the definition below. | |
// This is a really simplified example. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Loop over each found markdown file. | |
for file in content/*.md; do | |
# Check it's an actual readable file. | |
if [ -e "$file" ] ; then | |
# Get our 💩 together. | |
TEMPLATE=`cat template.html` | |
CONTENT=`cat "$file" | pandoc --no-highlight -f markdown` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Lightbulb_Interface { | |
// switch_on should have an arity of 0 | |
// it should turn on the thing. | |
switch_on() {} | |
// switch_off should have an arity of 0. | |
// it should turn off the thing. | |
switch_off() {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Frontroom_Light extends Lightbulb_Interface { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
const Joi = require("joi") | |
const my_class_schema = require("./schema") | |
class Interface { | |
constructor() { | |
// Get the members on this class. | |
const class_funcs = Object.getOwnPropertyNames(Object.getPrototypeOf(this)) | |
const class_as_object = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
const {symbols} = require("./recommended") | |
class Interface { | |
constructor() { | |
// Somewhere to keep the errors. | |
const errors = new Set() | |
// Get the symbolised field with our |