Skip to content

Instantly share code, notes, and snippets.

@mlconnor
mlconnor / flux_capacitor_beanstalk.json
Created November 18, 2013 18:57
This is a Cloud Formation template from the Flux Capacitor project. I really like this setup.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template Elastic-Beanstalk-in-vpc.template: Sample template showing how to create an Elastic Beanstalk environment in a VPC. The stack contains 2 subnets: the first subnet is public and contains the load balancer, a NAT device for internet access from the private subnet and a bastion host to allow SSH access to the Elastic Beanstalk hosts. The second subnet is private and contains the Elastic Beanstalk instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"BastionKeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the bastion host",
"Type" : "String",
@mlconnor
mlconnor / aws_iam_permissions.csv
Last active November 11, 2022 21:38
CSV file containing all AWS service names and permissions
Service Permission
Auto Scaling CreateAutoScalingGroup
Auto Scaling CreateLaunchConfiguration
Auto Scaling CreateOrUpdateScalingTrigger
Auto Scaling CreateOrUpdateTags
Auto Scaling DeleteAutoScalingGroup
Auto Scaling DeleteLaunchConfiguration
Auto Scaling DeleteNotificationConfiguration
Auto Scaling DeletePolicy
Auto Scaling DeleteScheduledAction
@mlconnor
mlconnor / small_crawler.js
Created November 21, 2013 20:08
Small link crawler for Firebug console
var entries = $('#query-apis ul li a');
var buffer = "";
for ( var i = 0; i < Math.min(entries.length); i++ ) {
var call = $(entries[i]).text();
$.ajax({
async: false,
url: entries[i].href,
success: function(res) {
//console.log(res);
var dc = $(res).find('#divContent .section:first .section > p:first');
@mlconnor
mlconnor / elastic_beanstalk_memory.txt
Created January 9, 2014 21:51
Apache Tomcat Memory Settings for Elastic Beanstalk
My findings….
The Apache Web Server footprint will basically be
Apache Web Server Footprint = MaxClients * (Max Memory per Child)
Ryan found our current Apache settings for EB to be…
ServerLimit 256
MaxClients 256
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@mlconnor
mlconnor / async_series.js
Created March 18, 2014 19:52
Using async in node.js
var async = require('async'),
async.series([
function(callback) {
setTimeout(function() {
console.log('f1');
callback(null, 'one');
}, 800);
},
function(callback) {
@mlconnor
mlconnor / regex.js
Created April 8, 2014 15:38
My regex notes
// match ip address but not internal 10.
"dkdl sld dj d 110.2.33.7 asjd ".match(/[^\d](?!10\.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/);
@mlconnor
mlconnor / pick_mixins.js
Last active August 29, 2015 14:01
String based pick mixins for underscore
_.mixin({
pickStartsWith : function(obj,beginStr) {
if ( _.isArray(obj) || ! _.isObject(obj) ) throw new TypeError("pickStartsWith must be called on an object");
return _.pick(obj, _.filter(_.keys(obj), function(el, index) { return el.indexOf(beginStr) == 0; }));
},
pickMatch : function(obj,regex) {
if ( _.isArray(obj) || ! _.isObject(obj) ) throw new TypeError("pickBeginsWith must be called on an object");
return _.pick(obj, _.filter(_.keys(obj), function(el, index) { return el.match(regex) != null; }));
},
keyReplace : function(obj,regex, replace) {
@mlconnor
mlconnor / excel_spreadsheet.html
Created June 26, 2014 18:39
Spreadsheet Excel in 31 lines of code
<!DOCTYPE html>
<html>
<head>
<!-- fiddle is here http://jsfiddle.net/ondras/hYfN3 -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Tiny Excel-like app in vanilla JS - jsFiddle demo by ondras</title>
<script type='text/javascript' src='/js/lib/dummy.js'></script>