Skip to content

Instantly share code, notes, and snippets.

View Nishchit14's full-sized avatar
🎯
Focusing

Nishchit Dhanani Nishchit14

🎯
Focusing
View GitHub Profile
@Nishchit14
Nishchit14 / AlertDialogProvider.tsx
Created April 23, 2024 13:33 — forked from alexanderson1993/AlertDialogProvider.tsx
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components.
"use client";
import * as React from "react";
import { Input } from "@/components/ui/Input";
import { Button } from "@/components/ui/Button";
import {
AlertDialog,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
@Nishchit14
Nishchit14 / Express-rest-apis.js
Last active June 17, 2018 10:17
Express vs Koa vs Hapi - REST APIs
// Expressjs REST APIs
const express = require('express');
const app = express();
cosnt router = express.Router();
let getUsersHandler = (req, res, next)=> {
//fetch users from database via ORM
res.send('Get - list users');
}
@Nishchit14
Nishchit14 / express_koa_hapi_landing.js
Created June 17, 2018 09:31
Express vs Koa vs Hapi - Landing Page
//Expressjs landing page
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello world, this is landing page');
});
let server = app.listen(3000, ()=> {
console.log('Express is listening to http://localhost:3000');
@Nishchit14
Nishchit14 / express_koa_hapi_server_setup.js
Last active June 17, 2018 09:16
Express vs Koa vs Hapi - Server setup
//Expressjs server setup
const express = require('express');
const app = express();
let server = app.listen(3000, ()=> {
console.log('Express is listening to http://localhost:3000');
});
@Nishchit14
Nishchit14 / FlattenArray
Created November 17, 2016 06:34
Native flatten in ES5 and ES6
//ES5 example
var flattenES5 = function (arr) {
return [].concat.apply([], arr.map(function (element) {
return Array.isArray(element) ? flatten(element) : element;
}))
}
//ES6 example
{
"name": "Report",
"version": "0.0.0",
"description": "report",
"homepage": "http://trailsjs.io",
"author": {
"name": "Nishchit Dhanani",
"email": "",
"url": "https://github.com/trailsjs"
},
@Nishchit14
Nishchit14 / designer.html
Last active August 29, 2015 14:17
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;