Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View neilmillard's full-sized avatar

Neil Millard neilmillard

View GitHub Profile
@neilmillard
neilmillard / etc-logstash-forwarder
Last active August 29, 2015 14:04
logstash forwarder install
{
"network": {
"servers": [ "kibana.ipaddr:5000" ],
"timeout": 15,
"ssl ca": "/etc/pki/tls/certs/logstash-forwarder.crt"
},
"files": [
{
"paths": [
"/var/log/messages",
<?
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@neilmillard
neilmillard / PDO_MySQL.php
Created July 29, 2014 12:38
kohana 3.2 pdo_mysql
<?php defined('SYSPATH') or die('No direct script access.');
class Database_PDO_MySQL extends Database_PDO {
public function list_columns($table, $like = NULL, $add_prefix = TRUE)
{
// Quote the table name
$table = ($add_prefix === TRUE) ? $this->quote_table($table) : $table;
if (is_string($like))
{
ember build
cp dist/index.html app/views/app.php
cp -r dist/assets public/assets
@neilmillard
neilmillard / emberinstall.sh
Created September 27, 2014 15:25
emberinstall.sh
# Install git
sudo apt-get install git -y
# Install node.js and npm
sudo apt-get install nodejs-legacy -y
sudo apt-get install npm -y
# Install bower
npm install -g bower
<?php
namespace Acme\Validation\Capsule;
use Illuminate\Validation\Factory;
use Illuminate\Validation\DatabasePresenceVerifier;
use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Translation\TranslatorInterface;
use Illuminate\Translation\Translator;
@neilmillard
neilmillard / tradecalc.php
Created February 27, 2015 11:40
note to calculate price
<?php
$highMid ="1.55515";
$lowMid = "1.5534";
function toPips($price)
{
return is_int($price) ? $price / 10000 : $price;
}
$spread = 5;
$high = ((float) substr(sprintf("%.4f", $highMid),0,6)) + toPips($spread);
class
{
"nm::webserver":
php_date_timezone => $php_date_timezone,
php_memory_limit => $php_memory_limit,
php_upload_max_filesize => $upload_max_filesize,
php_post_max_size => $php_post_max_size,
}
@neilmillard
neilmillard / RadarChart.js
Last active August 29, 2015 14:17 — forked from nbremer/.block
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3
//I only made some additions and aesthetic adjustments to make the chart look better
//(of course, that is only my point of view)
//Such as a better placement of the titles at each line end,
//adding numbers that reflect what each circular level stands for
//Not placing the last level and slight differences in color
//
//For a bit of extra information check the blog about it:
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html
@neilmillard
neilmillard / aws-user-data-file.sh
Last active August 29, 2015 14:17
headless puppet
#!/bin/sh
AWS_ACCESS_KEY="abcdefghijlmnopqrstu"
AWS_SECRET_KEY="abcdefghijlmnopqrstuabcdefghijlmnopqrstu"
BUCKET_PUPPET="puppet"
#export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
#export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
#export AWS_DEFAULT_REGION=eu-west-1
# update packages