Skip to content

Instantly share code, notes, and snippets.

View chrissiefken's full-sized avatar

Chris Siefken chrissiefken

  • Beanstalk Data
  • Charlotte, NC
View GitHub Profile
@chrissiefken
chrissiefken / gist:aa08a2633edb0ea9e993
Created December 22, 2014 15:10
PHP to delete EBS snapshots in a rolling window
<?php
date_default_timezone_set('UCT');
require '/usr/share/pear/AWSSDKforPHP/aws.phar';
use Aws\Ec2\Ec2Client;
$daysToSave = 14; // set this to the number of days to keep
$zone = '<zone>';
@chrissiefken
chrissiefken / gist:bdda397583416cd59547
Created December 22, 2014 15:07
PHP to snapshot a list of EBS volumes
<?php
require '/usr/share/pear/AWSSDKforPHP/aws.phar';
use Aws\Ec2\Ec2Client;
$zone = '<zone>';
$aws_creds = array(
'key' => '<key>',
nuke: function(refrigerator) {
if (!(refrigerator instanceof Array)) refrigerator = new Array(refrigerator);
for (var indy in $pt) {
if ($.inArray(indy, refrigerator) < 0) $pt.removeItem(indy);
}
}
@chrissiefken
chrissiefken / Idea for changing Asynchronous JS
Created August 17, 2013 19:11
A thought on how to make JavaScript callbacks and asynchronous code usage simpler by creating a prototype function called 'background'.
regularWork(); //im waiting to leave till im done work
driveHome(); // not executed yet because i'm still at work
background orderStatus = orderPizza('luigis'); // sending my order but I can still do other stuff while i wait
turnOnXbox(); //executed regardless of if my pizza is ready
while(orderStatus == 'not ready') {
playXbox(); //playing till its ready
}
turnOffXbox(); //about to eat
1 leek plant
1 bushel of asparagus
2 cups veggie broth
1 table spoon Butter
1 table spoon olive oil
Salt & pepper
First cut leek and asparagus into smaller less then 2 inch pieces.
Melt butter with olive oil