Skip to content

Instantly share code, notes, and snippets.

View designermonkey's full-sized avatar

John Porter designermonkey

View GitHub Profile
@designermonkey
designermonkey / Dockerfile
Created April 18, 2019 18:29
Symphony CMS with Docker
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 April 8, 2019 18:20 — forked from so0k/gist:cdd24d0a4ad92014a1bc
droplet discovery over digitalocean private networks

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
<?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);
var sassIncl = require('sass-include-paths'),
scssIncludePaths = sassIncl.nodeModulesSync();
exports.config = {
paths: {
watched: [
'app'
],
public: 'public'
},
@designermonkey
designermonkey / autossh.service
Created December 6, 2015 12:28 — forked from thomasfr/autossh.service
Systemd service for autossh
[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 September 30, 2015 09:15 — forked from akre54/backbone.fetch.js
Backbone.ajax with window.fetch
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 August 29, 2015 14:26 — forked from vdcrea/xml.xsl
xsl file to output xml used for unsa-industrie.org
<?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"
### 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 August 29, 2015 14:20
Docs for upcoming cookies and sessions changes

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

<?php
/**
* Beagle Bones
*/
namespace Beagle\Bones;
/**
* Middleware Decorator
*/
class MiddlewareDecorator