Skip to content

Instantly share code, notes, and snippets.

View bboure's full-sized avatar
🌍

Benoît Bouré bboure

🌍
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bboure on github.

  • I am bboure (https://keybase.io/bboure) on keybase.

  • I have a public key ASCcEctzFqLLwqfrHtKgYAZVjb4nKWGy2Qx-gVbGrYoHXwo

@bboure
bboure / synonyms.txt
Created February 29, 2020 23:40
spanish synonyms
acce, ac, acces
acces, ac, acceso
aceq, ae, acequia
acera, aa, acera
alam, al, alameda
aldap, ct, aldapa
aldea, ad, aldea
alque, aq, alqueria
alto, at, alto
andad, an, andador
{
"additional_data": {
"elevation": "/data/valhalla/elevation/"
},
"httpd": {
"service": {
"interrupt": "ipc:///tmp/interrupt",
"listen": "tcp://*:8002",
"loopback": "ipc:///tmp/loopback"
}
@bboure
bboure / serverless-part1.yml
Last active December 20, 2020 15:56
serverless-part1.yml
service:
name: appsync-long-cache
plugins:
- serverless-appsync-plugin
provider:
name: aws
custom:
@bboure
bboure / Query.wikipedia.request.vtl
Created December 20, 2020 15:58
appsync-long-cache-demo-wikipedia-request.vtl
{
"version": "2018-05-29",
"method": "GET",
"params": {
"query": {
"action": "query",
"format": "json",
"prop": "extracts",
"exintro": "true",
"titles": "${ctx.args.title}",
@bboure
bboure / schema.graphql
Created December 20, 2020 16:04
appsync-long-cache-demo-schema.graphql
type Query {
wikipedia(title: ID!): String!
}
schema {
query: Query
}
@bboure
bboure / gist:a4cd25732fd89ba76662077ff5b181c3
Created December 20, 2020 16:07
appsync-long-cache-demo-response-template.vtl
#if($ctx.result.statusCode == 200)
#set($body = $utils.parseJson($ctx.result.body))
#foreach ($page in $body.query.pages.entrySet())
#if ($page.value.title == $ctx.args.title)
#return($page.value.extract)
#end
#end
$utils.error("Article not found", "NotFound")
#else
$utils.error($ctx.result.statusCode, "Error")
@bboure
bboure / serverless.yml
Last active December 26, 2020 21:27
appsync-long-cache-demo-serverless.yml
mappingTemplates:
- type: Query
field: wikipedia
kind: PIPELINE
functions:
- fetchFromCache
- fetchWikipedia
- saveToCache
dataSources:
@bboure
bboure / read.js
Created March 15, 2021 09:51
DynamoDB gzip Large Attribute Values
const AWS = require('aws-sdk');
const { gunzipSync } = require('zlib');
AWS.config.update({ region: 'eu-west-1' });
const dynamoDbClient = new AWS.DynamoDB();
dynamoDbClient.getItem({
"TableName": "blog",
"ReturnConsumedCapacity": "TOTAL",
"Key": {
@bboure
bboure / abort.sh
Last active August 9, 2021 08:55
Stop Step Functions by batch
aws stepfunctions list-executions \
--state-machine-arn [sf-arn] \
--status-filter RUNNING \
--query "executions[*].{executionArn:executionArn}" \
--output text | \
xargs -I {} aws stepfunctions stop-execution \
--execution-arn {}