Skip to content

Instantly share code, notes, and snippets.

@grvhi
grvhi / gist:fbda7c0afed03ae1ef8c
Created February 23, 2015 18:30
AWS Lambda Function to Trigger ElasticTranscoder Job on S3 Upload
console.log('Checking newly uploaded file');
var AWS = require('aws-sdk');
var s3 = new AWS.S3({apiVersion: '2006-03-01'});
var eltr = new AWS.ElasticTranscoder({
apiVersion: '2012-09-25',
region: 'us-east-1'
});
// ID of pipeline
var pipelineId = 'myID';
// ID of ET's web output preset
@grvhi
grvhi / gist:347dd865e250647fcf63
Last active August 29, 2015 14:15
Example of Multiple Grok Patterns in Logstash.conf
# NOTE: I don't think this is documented behaviour. I've used this output format in production on multiple servers for some time with no issues, but please test thoroughly!!!! And don't read too much into the patterns: dummies for this example
input {
file {
path => "/tmp/tasks.log"
start_position => end
sincedb_path => "/tmp/"
}
}
filter {
@grvhi
grvhi / twbs-btn-gradients
Last active October 21, 2022 22:24
A simple CSS overwrite to add old-style gradients to Bootstrap 3 flat buttons. CSS created from http://twitterbootstrap3buttons.w3masters.nl
.btn-primary {
background-color: #08c;
border-color: #08c;
color: #fff;
background-color: #007ab8;
background-image: -moz-linear-gradient(top, #08c, #006699);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#006699));
background-image: -webkit-linear-gradient(top, #08c, #006699);
background-image: -o-linear-gradient(top, #08c, #006699);
background-image: linear-gradient(to bottom, #08c, #006699);