Skip to content

Instantly share code, notes, and snippets.

View abc0990cba's full-sized avatar
🍍
Focusing

abc0990cba

🍍
Focusing
View GitHub Profile
@programmerShinobi
programmerShinobi / setup-exceljs-library-in-nestjs-framework.sh
Last active March 20, 2024 18:34
Setup exceljs library in nestjs framework
#1 Install dependecies :
- fs-extra
- exceljs
- multer
- @types/multer
- lodash
- class-validator
- class-transformer
- rxjs
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@mmmeff
mmmeff / 00-ReactToolFactory.tsx
Last active April 15, 2024 13:47
A simple Typescript-forward utility that spits out Editor.js tools for React components. You may need to include relevant Context providers for your application as wrappers around whatever <Component> is rendered by the factory
// Based on https://walkthrough.so/pblc/QCawSCKwOQLn/creating-a-custom-editorjs-block-tool-with-react
import type {
API,
BlockAPI,
BlockTool,
BlockToolConstructorOptions,
} from '@editorjs/editorjs'
import ReactDOM from 'react-dom'
@thomasdarimont
thomasdarimont / main.go
Last active March 11, 2026 10:15
Keycloak Go RP Client Example with PKCE
/*
This is an example about how to use a public client written in Golang to authenticate using Keycloak.
This example is only for demonstration purposes and lacks important
*/
package main
import (
"encoding/json"
"errors"
"log"
@bradtraversy
bradtraversy / mern-server-setup.md
Last active February 5, 2026 06:33
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@kursademirtas
kursademirtas / Slider.js
Created December 6, 2021 08:02
Slider Component
import { useState } from "react";
import styled from "styled-components";
import { useKeenSlider } from "keen-slider/react";
import {SliderProductCard} from "@components/ui";
import { ArrowFilterIcon } from "@components/icons";
import { colors } from "styles/variables";
const ProductSlider = ({
background,

Setup Eslint Prettier and Husky in Node JS Typescript Project

1. ESLint

  • Step 1 - Install the dependencies

    • eslint
      • ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
      • npm install --save-dev eslint
    • typescript-eslint/parser
@thisismydesign
thisismydesign / google-oauth.controller.ts
Last active March 3, 2026 03:51
OAuth2 in NestJS for social login (Google, Facebook, Twitter, etc) /1
import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common';
import { Request, Response } from 'express';
import { GoogleOauthGuard } from './google-oauth.guard';
@Controller('auth/google')
export class GoogleOauthController {
constructor(private jwtAuthService: JwtAuthService) {}
@Get()
@UseGuards(GoogleOauthGuard)
@roqbez
roqbez / import_excel.js
Created April 30, 2021 00:00
Node.js + Nest.js code to import Excel file to a database
import { HttpService, Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { ReadStream } from 'fs';
import { Sequelize } from 'sequelize-typescript';
import * as xlsx from 'xlsx';
import { WorkBook, WorkSheet } from 'xlsx';
import { ArquivoImportacao } from './dto/arquivo-importacao.dto';
@Injectable()
export class ImportacaoProcessosService {
@nandorojo
nandorojo / use-swr-infinite-enhanced.ts
Last active July 10, 2023 11:01
useSWRInfinite with pagination & typescript safety
import { ConfigInterface, useSWRInfinite } from 'swr'
import { useMemo, useCallback, useRef } from 'react'
import last from 'lodash.last'
import get from 'lodash.get'
type PageKeyMaker<Page, Key extends any[]> = (
index: number,
previousPageData?: Page
/**
* Mutable ref object. Set this to `true` before the request and `false` afterwards if the request is fetching more.