Skip to content

Instantly share code, notes, and snippets.

View dbrrt's full-sized avatar
🚲

David Barrat dbrrt

🚲
View GitHub Profile
#!/usr/bin/env bash
docker pull fauna/faunadb
docker container stop faunadb || true && docker container rm faunadb || true
docker run --name faunadb -d \
--health-cmd="faunadb-admin status" --health-interval=2s \
-p 8443:8443 \
-p 8084:8084 \
fauna/faunadb
./docker/wait-for-healthy.sh faunadb 30
@benawad
benawad / web-deploy.yml
Created March 28, 2020 02:45
Github Action for deploying https://www.mysaffronapp.com/ website
name: web-deploy
on:
push:
tags:
- "web-*"
- "both-*"
jobs:
landing:
@fauna-brecht
fauna-brecht / rate-limiting-fauna.js
Last active November 28, 2022 12:13
Rate limiting FaunaDb
import { rateLimiting } from '../../fauna-queries/helpers/errors'
import faunadb from 'faunadb'
/*
* Ideally we limit the amount of calls that come to Login.
*/
const q = faunadb.query
const {
If,
Epoch,
Match,
@pascalwhoop
pascalwhoop / cleanup.sh
Created November 20, 2019 14:08
Cleans the Kubernetes API of all pods in a namespace (in our case airflow)
NAMESPACE=airflow
#edit the > 3 < in the jq statement to correspond to the number of days you want to keep pods around for
kubectl delete pod -n $NAMESPACE $(kubectl get pods -n $NAMESPACE -o json | jq -r '.items[] |
select(.status.phase != "Running") |
select(last(.status.containerStatuses)[].state | has("terminated")) |
select((last(.status.containerStatuses)[].state.terminated.finishedAt | fromdate) < (now - 60*60*24*3)) |
.metadata.name')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trfiladelfo
trfiladelfo / script.md
Created July 6, 2019 17:28
install postman in linux mint

When it comes to API development, my weapon of choice for testing my code is Postman. I start using Postman since it's still a Chrome App. Now it encourages its user to use Postman Native app. I definitely love the idea, but all I can find is a download link without any installation document for Linux Mint.

So, here's what I did:

Download postman
$ wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

Extract archive
$ sudo tar -xzf postman.tar.gz -C /opt
In order to work the Bose QC35 Headset Bluetooth do the following:
- sudo pacman -Syu pulseaudio-alsa pulseaudio-bluetooth bluez bluez-libs bluez-utils
- turn off bluetooth from your computer
- sudo btmgmt ssp of
- gpasswd -a YOUR_USER lp
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@thebuilder
thebuilder / Example.story.js
Last active November 5, 2020 10:34
Mock Fetch requests in Storybook
import React from 'react'
import { storiesOf } from '@storybook/react'
import FetchStory from './FetchStory'
storiesOf('Fetch Example', module)
.add('Plain', () => (
<FetchStory mocks={{
matcher: '/api/signup',
response: {
body: {

The default format of keys was changed in OpenSSL 1.0. From OpenSSL 1.0 change log:

Make PKCS#8 the default write format for private keys, replacing the traditional format. This form is standardised, more secure and doesn't include an implicit MD5 dependency. [Steve Henson]

Good explanations of the difference between the two formats: https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem

Converting RSA private key: