Skip to content

Instantly share code, notes, and snippets.

Avatar

John Porter designermonkey

View GitHub Profile
@designermonkey
designermonkey / Dockerfile
Created Apr 18, 2019
Symphony CMS with Docker
View Dockerfile
FROM php:5.6-apache
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install opcache
RUN docker-php-ext-install pdo_mysql
RUN apt-get update
RUN apt-get install libxslt-dev zlib1g-dev -y
RUN docker-php-ext-install xsl
@designermonkey
designermonkey / gist:89ecada4c5c0592d760f22923d71fa23
Created Apr 8, 2019 — forked from so0k/gist:cdd24d0a4ad92014a1bc
droplet discovery over digitalocean private networks
View gist:89ecada4c5c0592d760f22923d71fa23

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
View relative_path.php
<?php
if (!function_exists('relative_path')) {
function relative_path(string $from, string $to): string {
// some compatibility fixes for Windows paths
$from = is_dir($from) ? rtrim($from, '\/') . '/' : $from;
$to = is_dir($to) ? rtrim($to, '\/') . '/' : $to;
$from = str_replace('\\', '/', $from);
$to = str_replace('\\', '/', $to);
View brunch-config.js
var sassIncl = require('sass-include-paths'),
scssIncludePaths = sassIncl.nodeModulesSync();
exports.config = {
paths: {
watched: [
'app'
],
public: 'public'
},
@designermonkey
designermonkey / autossh.service
Created Dec 6, 2015 — forked from thomasfr/autossh.service
Systemd service for autossh
View autossh.service
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@designermonkey
designermonkey / backbone.fetch.js
Created Sep 30, 2015 — forked from akre54/backbone.fetch.js
Backbone.ajax with window.fetch
View backbone.fetch.js
var defaults = function(obj, source) {
for (var prop in source) {
if (obj[prop] === undefined) obj[prop] = source[prop];
}
return obj;
}
var stringifyGETParams = function(url, data) {
var query = '';
for (var key in data) {
@designermonkey
designermonkey / xml.xsl
Last active Aug 29, 2015 — forked from vdcrea/xml.xsl
xsl file to output xml used for unsa-industrie.org
View xml.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xls="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:string="http://www.getsymphony.com/functions"
exclude-result-prefixes="xls string">
<xsl:import href="../utilities/functions/function.string.utilities.xsl"/>
<xsl:output method="xml"
View ElasticSearch.sh
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@designermonkey
designermonkey / gist:378e965a4b36fe24b46c
Last active Aug 29, 2015
Docs for upcoming cookies and sessions changes
View gist:378e965a4b36fe24b46c

Docs for Session and Cookie.

Updates related to the Session and Cookie classes.

Container

Container is a very simple one which can be used as is or extended by a developers class in an extension for example.

Access Methods

View gist:d8ed86868e2fe7ebc4ae
<?php
/**
* Beagle Bones
*/
namespace Beagle\Bones;
/**
* Middleware Decorator
*/
class MiddlewareDecorator