Skip to content

Instantly share code, notes, and snippets.

openapi: "3.0.1"
info:
title: "demo-test-verification"
version: "2019-12-27T23:52:02Z"
servers:
- url: "https://xxx.execute-api.us-east-1.amazonaws.com/{basePath}"
variables:
basePath:
default: "/prod"
paths:
@vladholubiev
vladholubiev / git-clean-branches.sh
Created September 17, 2018 07:43
git clean-branches - removes any local branch which is not master/develop(ment)
git config --global alias.clean-branches '!git branch | grep -v "master\|develop" | xargs git branch -D'
## This is a list of RPM packages available on AWS Lambda, Node.js 8.10 runtime, 22 May 2019, Amazon Linux 2018.03
## See https://github.com/claudiajs/lambda-vm-info for how this list was generated and to get an updated version
Installed Packages
ImageMagick.x86_64 6.7.8.9-15.21.amzn1 @amzn-main
alsa-lib.x86_64 1.0.22-3.9.amzn1 @amzn-main
audit-libs.x86_64 2.6.5-3.28.amzn1 @amzn-main
avahi-libs.x86_64 0.6.25-12.17.amzn1 @amzn-main
basesystem.noarch 10.0-4.9.amzn1 @amzn-main
@vladholubiev
vladholubiev / aws-lambda-libraries.txt
Last active July 24, 2022 15:51 — forked from gojko/gist:aaea440be880d0162767639f8a6681f9
Libraries available in AWS Lambda
# AWS Lambda `ldconfig -p`, region `us-east-1`, nodejs 8.10 runtime, 22 May 2019, Amazon Linux 2018.03
# See https://github.com/claudiajs/lambda-vm-info for how this was generated and to create an updated version
241 libs found in cache `/etc/ld.so.cache'
libz.so.1 (libc6,x86-64) => /lib64/libz.so.1
libxslt.so.1 (libc6,x86-64) => /usr/lib64/libxslt.so.1
libxshmfence.so.1 (libc6,x86-64) => /usr/lib64/libxshmfence.so.1
libxml2.so.2 (libc6,x86-64) => /usr/lib64/libxml2.so.2
libxcb.so.1 (libc6,x86-64) => /usr/lib64/libxcb.so.1
libxcb-xvmc.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xvmc.so.0
digraph architecture {
rankdir=LR;
// Storage - #303F9F (dark blue)
node[fillcolor="#303F9F" style="filled" fontcolor="white"];
database[label="DB"]; cache[label="Redis"];
// Client-side Apps - #FFEB3B (yellow)
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"];
front_end[label="Front-end App"]; extension[label="Browser Extension"];
digraph architecture {
rankdir=LR;
subgraph client_side_apps {
front_end -> {auth_api, my_app_api};
extension -> {auth_api, my_app_api};
{rank=same; front_end, extension, auth_api};
}

REPORT Duration: 353.52 ms Billed Duration: 400 ms Memory Size: 1536 MB
REPORT Duration: 340.44 ms Billed Duration: 400 ms Memory Size: 1536 MB
REPORT Duration: 356.91 ms Billed Duration: 400 ms Memory Size: 1536 MB
REPORT Duration: 280.49 ms Billed Duration: 300 ms Memory Size: 1536 MB
REPORT Duration: 336.75 ms Billed Duration: 400 ms Memory Size: 1536 MB

REPORT Duration: 2120.67 ms Billed Duration: 2200 ms Memory Size: 128 MB
REPORT Duration: 2778.51 ms Billed Duration: 2800 ms Memory Size: 128 MB
REPORT Duration: 2185.11 ms Billed Duration: 2200 ms Memory Size: 128 MB
REPORT Duration: 1883.18 ms Billed Duration: 1900 ms Memory Size: 128 MB

require(dplyr)
require(data.table)
questions <- tbl_df(fread(input = "questions.csv", header = TRUE, sep = ",")) %>%
mutate(Score = as.integer(Score)) %>%
mutate(ViewCount = as.integer(ViewCount)) %>%
mutate(CreationDate = as.Date(CreationDate)) %>%
mutate(Tags = Tags %>%
gsub("<", "", .) %>%
gsub(">", ",", .) %>%

Returns a list of locations of users who asked a question about MongoDB.

SELECT Users.Location
FROM Posts
INNER JOIN Users
ON Posts.OwnerUserId = Users.Id
WHERE Posts.Tags LIKE '%mongodb%'
AND Users.Location IS NOT NULL
AND RTrim(Users.Location) &gt; ''