Skip to content

Instantly share code, notes, and snippets.

View shellking4's full-sized avatar

Donald KANTI shellking4

View GitHub Profile
@shellking4
shellking4 / bomboo-webhook-snippet.ts
Last active August 19, 2024 09:34
bomboo-webhook-snippet
@Post('bomboo-webhook')
@Accessible()
async bombooWebhook(
@Req() request: RawBodyRequest<Request>,
@Res() response: Response
) {
const endpointSecret = this.configService.get('BOMBOO_WEBHOOK_SECRET');
const signature = request.headers['x-bomboo-signature'] as string;
const { rawBody } = request
const isValidSignature = isValidHmacSignature(signature, rawBody, endpointSecret);
@shellking4
shellking4 / aparsys-api
Last active April 15, 2023 12:03
nginx config ssl
#SSL certificates issuing
sudo openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 36500 -keyout /etc/ssl/main.key -out /etc/ssl/main.crt
# Nginx Conf
upstream backend {
server 127.0.0.1:3000;
keepalive 64;
}
{
"departements": [
{
"name": "ALIBORI",
"towns": [
{
"name": "SEGBANA",
"districts": [
{
"name": "LIBANTE",
@shellking4
shellking4 / simple-pagination.js
Created December 22, 2022 14:05 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;