Skip to content

Instantly share code, notes, and snippets.

View RATTLESNAKE-VIPER's full-sized avatar

Gautam RATTLESNAKE-VIPER

  • Mumbai,Maharashtra,India
View GitHub Profile
@psteinroe
psteinroe / Dockerfile
Last active June 20, 2022 02:01
cd.yaml
FROM node:fermium-alpine AS builder
WORKDIR /app/builder
COPY . .
# https://github.com/nodejs/docker-node/issues/384#issuecomment-305208112
RUN apk --no-cache add --virtual native-deps \
git g++ gcc libgcc libstdc++ linux-headers make python && \
yarn global add --silent node-gyp &&\
yarn --silent && \
apk del native-deps
@leopoldodonnell
leopoldodonnell / APlaceToStart.md
Last active July 15, 2021 19:43
Nestjs Startup

Nestjs In Under 15 Minutes

If you've got 15 minutes to spare and have docker installed, this Gist will get you started with a working debuggable Nestjs application using Docker with additional settings for vscode. Clearly you'll want to dig deeper, but this is a start...

Nestjs is a popular nodejs for typescript framework for building microservices. It enjoys a large active community, has many extensions and is easily extended. Documentation can be found here

Create the basic file structure from the Github Gist

@theanam
theanam / otpverify.js
Last active June 14, 2024 15:01
OTP verification without database, full sample source code
const otpGenerator = require("otp-generator");
const crypto = require("crypto");
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret
function createNewOTP(phone){
// Generate a 6 digit numeric OTP
const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false});
const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds
const expires = Date.now() + ttl; //timestamp to 5 minutes in the future
const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp
@dalaidunc
dalaidunc / makedata.js
Last active February 14, 2019 09:28
Create CSV files with dummy data (using node.js)
const fs = require('fs');
const cols = 8;
function randomChar () {
return String.fromCharCode(Math.floor(Math.random() * (122-65) + 65));
}
function randomString (length) {
let string = '';
@brennanMKE
brennanMKE / hero.ts
Last active July 15, 2024 15:25
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
Using cron to perform incremental Map-Reduce in MongoDB
@jpsim
jpsim / JAZMusician.h
Created July 7, 2014 09:25
SourceKit Playground
//
// JAZMusician.h
// JazzyApp
//
#import <Foundation/Foundation.h>
/**
JAZMusician models, you guessed it... Jazz Musicians!
From Ellington to Marsalis, this class has you covered.
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active July 19, 2024 01:24
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository