Skip to content

Instantly share code, notes, and snippets.

View seangates's full-sized avatar
Revvable

Sean Gates seangates

Revvable
View GitHub Profile
@seangates
seangates / index.js
Created September 28, 2017 15:37
Simple Express Web Server
let path = require('path');
let express = require('express');
let port = process.env.PORT || 8080;
let isProduction = process.env.NODE_ENV === 'production';
let app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
@seangates
seangates / installing express
Last active September 28, 2017 15:21
Installing Express
npm install express
@seangates
seangates / knack.js
Created February 28, 2017 05:06
A simple way to use Knack requests in your Node.js app.
'use strict';
const rp = require('request-promise');
const _ = require('lodash');
class Knack {
constructor(config) {
this.knackBasePath = config.knackBasePath;
this.knackOptions = config.knackOptions;
}
<?php
$using_ssl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_PORT'] == 443;
add_action('wp', 'check_ssl');
function check_ssl()
{
$page_id = 2;// Page ID 2 must be https
if (is_page($page_id) && !$using_ssl)
{
header('HTTP/1.1 301 Moved Permanently');