Skip to content

Instantly share code, notes, and snippets.

@jdesulme
jdesulme / aws_sg_recipe.py
Created May 9, 2018 21:02 — forked from steder/aws_sg_recipe.py
Create and update AWS security groups using Python and Boto.
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
@jdesulme
jdesulme / gist:4946020
Created February 13, 2013 16:51
Creates a new row in a table by cloning the last row and incrementing the name and id values by 1 to making them unique
function addTableRow(table){
// clone the last row in the table
var $tr = $(table).find("tbody tr:last").clone();
//add the delete button only once
if ($(table).find('tbody tr').length == 1){
$('<td><a class="button"><span class="delete">Delete</span></a></td>').appendTo($tr);
}
//clear any existing values