Skip to content

Instantly share code, notes, and snippets.

View sebdah's full-sized avatar
:shipit:
Trust the source

Sebastian Dahlgren sebdah

:shipit:
Trust the source
View GitHub Profile
@muhqu
muhqu / tda-stale-ami-snapshots.sh
Created May 20, 2014 09:03
ShellScript to output EBS Snapshots that are no longer referenced by AMIs
#!/bin/bash
aws ec2 describe-snapshots --owner-ids $AWS_ACCOUNT_ID > snapshots.json
aws ec2 describe-images --owners $AWS_ACCOUNT_ID > images.json
cat snapshots.json \
| jq '.Snapshots[] | select(.Description//""|startswith("Created by CreateImage"))' \
> snapshot-to-ami.json
cat images.json \
@aheckmann
aheckmann / mongoose_with_mongo2-2_elemMatch_projection.js
Created September 5, 2012 17:31
using the $elemMatch projection with mongoose
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_1085';
mongoose.connect('localhost', dbname);
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
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 {
@datagrok
datagrok / gist:2199506
Last active August 22, 2024 14:21
Virtualenv's `bin/activate` is Doing It Wrong
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()