Skip to content

Instantly share code, notes, and snippets.

View CodingNinja's full-sized avatar
🏠
Working from home

David Mann CodingNinja

🏠
Working from home
View GitHub Profile
@CodingNinja
CodingNinja / Manager.php
Created December 30, 2011 13:09
Grant / Revoke ACL Permissions
<?php
/*
* Copyright (C) 2011 David Mann
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
<?php
namespace Ninja\BundleExtensionsBundle\Factory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\NodeInterface;
/**
* Contract for an BundleExtension to implement
@CodingNinja
CodingNinja / default.vcl
Created May 31, 2012 13:29
Remote Proxy with Varnish
# Our origin backend
backend blogs {
.host = "blogs.dev";
.port = "8888";
}
# Our proxy backend
backend remote {
.host = "proxy.local";
.port = "8888";
backend blogs {
.host = "blogs.dev";
.port = "80";
}
backend remote {
.host = "proxy.ying";
.port = "80";
}
@CodingNinja
CodingNinja / mineSimulator.js
Last active August 29, 2015 14:06
Mine output simulator
/**
* Dump Truck simulator
*
* Simple simulator that emulates a mining environment and allows
* one to plot the potential output of a mines operation.
*
* @author David Mann <[email protected]>
*/
var currentTime = 1, runTime = ((60*1)*60), events = [], tonnageCarried = 0, maxSimultaneousDump = 1;
@CodingNinja
CodingNinja / supervisord-example.conf
Last active July 28, 2016 03:24 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@CodingNinja
CodingNinja / rm-imports.js
Created November 6, 2017 18:19
JS Codemode to remove unused imports - https://Retroanalytics.io
module.exports = (file, api, options) => {
const j = api.jscodeshift;
const printOptions = options.printOptions || { quote: "single" };
const root = j(file.source);
const filterAndTransformRequires = path => {
const specifiers = path.value.specifiers;
const parentScope = j(path).closestScope();
@CodingNinja
CodingNinja / README.md
Last active April 9, 2018 01:17
Argbash Interpreter

Simple wrapper around argbash to enable Argbash scripts without the need for directly compiling as changes are made

A shasum of the script is generated when run and this is compared with the exxisting files hash, if it's changed, we compile the script with argbash, save it to the cache folder and run the rebuilt file