Skip to content

Instantly share code, notes, and snippets.


Dimitri DO BAIRRO rimiti

View GitHub Profile
View important.txt
如有Agent问题,请前往 反馈。
请认准 jetbrains-agent 一手更新:
rimiti / ipstack.ts
Last active Jul 31, 2020
Typescript implementation of ipstack
View ipstack.ts
import axios, { AxiosResponse } from 'axios';
import { config } from '../config';
import { Sentry } from '../libs/sentry';
* @description Ip Stack API response
interface IIpStackResponse {
latitude: number;
longitude: number;
rimiti / example.js
Created Oct 1, 2019
Javascript: Creating a custom javascript error
View example.js
export class RequestError extends Error {
constructor(message, meta = {}) {
this.message = message;
this.meta = meta;
rimiti / sentry.js
Created Oct 1, 2019
Example to capture a Sentry exception
View sentry.js
const Sentry = require('@sentry/node');
Sentry.init({ dsn: process.env.SENTRY_DSN, environment: 'staging' });
Sentry.captureException(new Error('Test from local'));
rimiti / 🙈❤️.png
Last active Oct 25, 2019
Raccoon﹠Monkey lover ❤️
rimiti / index.js
Created Apr 23, 2019
Loop: running promises in sequential.
View index.js
* @description Runs getUser() in sequential.
* @return {Promise<void>}
async function example() {
for (let i = 0; i < 10; i++) {
await getUser();
hadrienblanc /
Last active Jan 10, 2019
Git submodules cheatsheet

Git Submodules cheatsheet

Why having a submodule ?

With git you can add a submodule to a repository. A submodule is another repository inside a repository.

How to create a submodule ?

git submodule add path_to_my_submodule
npearce /
Last active Nov 30, 2020
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See:

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
rimiti / upload-to-s3-steam.js
Created Nov 20, 2018
NodeJS - Upload local (file) image to AWS S3 from stream with public access.
View upload-to-s3-steam.js
const AWS = require('aws-sdk');
const fs = require('fs');
AWS.config.update({ accessKeyId: 'ACCESSKEYID', secretAccessKey: 'SECRETACCESSKEY', region: 'eu-west-3'});
const fileStream = fs.createReadStream('/path/to/your/image.png');
fileStream.on('error', function (err) {
if (err) { throw err; }
rimiti /
Last active Jul 5, 2018
Install kubernetes on Debian 9 (
# Install common and docker
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | apt-key add -
add-apt-repository "deb$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
# Install kubelet, kubeadm kubectl
You can’t perform that action at this time.