Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Focusing

Dimitri DO BAIRRO rimiti

🚀
Focusing
View GitHub Profile
@rimiti
rimiti / README.md
Last active May 19, 2021
Install OpenVPN through docker
View README.md

How to install an OpenVPN server (through Docker)

  1. Create an openvpn folder
mkdir -p ~/openvpn/data
  1. Create the configuration
@rimiti
rimiti / README.md
Last active Jun 16, 2021
Parcoursup </> Prise de rendez-vous
View README.md

API recette:

curl --location --request POST 'https://rdv-cfa-recette.apprentissage.beta.gouv.fr/api/appointment-request/context/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idParcoursup": "25229",
    "referrer": "parcoursup"
}'
@rimiti
rimiti / script.js
Created Jun 23, 2020
Stream big csv file
View script.js
const fs = require('fs');
const csv = require('csvtojson');
const csvStream = fs.createReadStream('./file.csv');
const converter = new csv.Converter({});
converter
.fromStream(csvStream)
.subscribe((row) => {
@rimiti
rimiti / NPM_PUBLISH.md
Created Dec 26, 2019
To check what it will be publish on npm before publishing
View NPM_PUBLISH.md

To check what it will be publish on npm before publishing:

npm pack && tar -xvzf *.tgz && rm -rf package *.tgz
@rimiti
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
rimiti / example.js
Created Oct 1, 2019
Javascript: Creating a custom javascript error
View example.js
export class RequestError extends Error {
constructor(message, meta = {}) {
super();
this.message = message;
this.meta = meta;
}
}
@rimiti
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
rimiti / index.js
Last active Aug 20, 2019
Sending an email with Mandrill
View index.js
const nodemailer = require("nodemailer");
const mandrillTransport = require('nodemailer-mandrill-transport');
const smtpTransport = nodemailer.createTransport(mandrillTransport({
auth: {
apiKey : 'your-token'
}
}));
const mailData = {
View index.html
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
<!--<html xmlns="http://www.w3.org/1999/xhtml">-->
<!--<head>-->
<!-- <title>Test Layout</title>-->
<!-- <style type="text/css">-->
<!-- body, html-->
<!-- {-->
<!-- margin: 0; padding: 0; height: 100%; overflow: hidden;-->
<!-- }-->