Skip to content

Instantly share code, notes, and snippets.

View stojanovic's full-sized avatar

Slobodan Stojanović stojanovic

View GitHub Profile
@stojanovic
stojanovic / README.md
Last active December 8, 2019 00:26
Lambda Destinations for synchronous invocations

Serverless has two killer features:

  1. Rewards good practices, better than any other architecture before. For example, if you optimize and refactor your app to run faster, you'll be rewarded with cheaper infrastructure. That makes refactoring decision easy, as it can be backed with numbers.
  2. Promises to help us to shift our focus to our business logic. For example, users of my leave-tracking app don't really care if we store our data in MySQL or DynamoDB, or if our Stripe webhooks are delivered to the server or the Lambda function, as long as our system works reliably and don't compromise their data.

I think AWS is heading in that direction, but I also agree with Joe Emisson (as almost always), when he says:

AWS really needs someone at the VP level (like @adrianco has done for open source) to influence (but not dictate) easier, more-opinionated ways of using the services for the 80% use case (e.g., CRUD apps).

@stojanovic
stojanovic / lambda.js
Created January 24, 2018 10:39
Lambda@Edge with Claudia.js
exports.handler = (event, ctx, cb) => {
const status = '200'
const headers = {
'content-type': [{
key: 'Content-Type',
value: 'application/json'
}]
}
var botBuilder = require('claudia-bot-builder');
module.exports = botBuilder(function (request) {
return 'Thanks for sending ' + request.text;
});
# Get current git branch if it exists
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Custom prompt, in this case format is "slobodan:someDir (git_branch_name) 🚀 "
export PS1="\u:\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] 🚀 "
@stojanovic
stojanovic / calendar.html
Created December 22, 2015 22:04
Simple calendar layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class=calendar>
<div class=month>
<h3>JAN</h3>
@stojanovic
stojanovic / watchify browserlfy babelify
Last active August 29, 2015 14:25 — forked from mobz/watchify browserlfy babelify
one line build system for browserify babeljs and watch ( watchify / babelify )
./node_modules/watchify/bin/cmd.js -v -t babelify src -o dist

Keybase proof

I hereby claim:

  • I am stojanovic on github.
  • I am slobodan (https://keybase.io/slobodan) on keybase.
  • I have a public key whose fingerprint is EF68 1150 90D1 F4CA 25CA 13CE 2B24 0B98 51BB C41A

To claim this, I am signing this object: