Skip to content

Instantly share code, notes, and snippets.

View ngmaloney's full-sized avatar

Nick Maloney ngmaloney

View GitHub Profile
@ngmaloney
ngmaloney / extra-httpd-vhosts.conf
Created August 11, 2011 18:30
extra/httpd-vhosts.conf
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
@ngmaloney
ngmaloney / gist:1260782
Created October 4, 2011 02:38
RetentionCalculator
function retentionCalculator(opts) {
var opts = opts || {};
this.init = function(opts) {
this.price = opts.price || 300; //Product Price
this.margin = opts.margin || 0.085; //Profit Margin
this.cost = opts.cost || 0; //Retention Cost
this.lifetime = opts.lifetime || 3; //Product Lifetime
this.inflation = opts.inflation || 0.05; //Inflation Rate
this.network = opts.network || 100; //Network Size
this.influence = opts.influence || 0.01; //Network Conversion Influence
@ngmaloney
ngmaloney / gist:1473603
Created December 13, 2011 19:55
Nodeshot calling shell script
var cmd = './lib/bin/nodeshot ' + remote_url + ' ' + path + filename + ' ' + width + 'x' + height;
child = exec(cmd, {timeout: 20000}, function(error, stdout, stderr) {
//handler code here
}
numberPuzzle=function(a){var b=function(a){var b=parseInt(a,10);if(b===8){return 2}else if(b===6||b===9||b===0){return 1}return 0};var c=function(a){var b=0;var c;for(c=0;c<a.length;c+=1){b+=a[c]}return b};return c(String(a).split("").map(b))}
@ngmaloney
ngmaloney / speedtest.sh
Created January 3, 2013 06:04
Quick and dirty cli speed tester.
#!/bin/bash
LOG=~/Desktop/speedtest.log
FILE=http://speedtest.wdc01.softlayer.com/downloads/test10.zip
echo "scale=2; `curl --progress-bar -w "%{speed_download}" $FILE -o test.zip` / 131072" | bc | xargs -I {} echo `date` {} Mb\/s >> $LOG
rm ./test.zip
@ngmaloney
ngmaloney / gist:9689054
Created March 21, 2014 15:41
Procfile.dev
db: mysqld
redis: redis-server /usr/local/etc/redis.conf
web: bundle exec rails server -p 3001

Keybase proof

I hereby claim:

  • I am ngmaloney on github.
  • I am ngmaloney (https://keybase.io/ngmaloney) on keybase.
  • I have a public key whose fingerprint is 92FC FDF1 A39A F2FE BBFB 77D4 3C4F D1B0 0B0F AC71

To claim this, I am signing this object:

@ngmaloney
ngmaloney / _config.yml
Created October 16, 2015 01:06
Sample Jekyll Config
---
title: Jekyll Test
url: http://localhost:4000
timezone: UTC
permalink: pretty
defaults:
scope:
path: ""
values:
layout: "default"
@ngmaloney
ngmaloney / keybase.md
Created February 11, 2017 20:16
keybase.md

Keybase proof

I hereby claim:

  • I am ngmaloney on github.
  • I am ngmaloney (https://keybase.io/ngmaloney) on keybase.
  • I have a public key ASBt8LCxG1N-GKuX1VCrA3g3U-H1bq4vDOwTX02kjT0bLQo

To claim this, I am signing this object: