Skip to content

Instantly share code, notes, and snippets.

View debashisbarman's full-sized avatar
🇮🇳

Debashis Barman debashisbarman

🇮🇳
View GitHub Profile
@debashisbarman
debashisbarman / detectWebTechnologies.js
Created February 21, 2025 06:59
Web technologies detection
const WebTechDetector = {
// Core detection logic
technologies: [],
// Utility methods
utils: {
// Convert to array if not already
toArray: (value) => (Array.isArray(value) ? value : [value]),
// Create regex pattern
import requests
from functools import partial
import json
import openai
from termcolor import colored
MAX_ITERATIONS = 4
BASE_URL = "https://api.example.com"
@debashisbarman
debashisbarman / dialogue-manager.md
Created March 8, 2023 19:12
NLP Dialogue Manager in JavaScript

Here's an example of how the NLP dialogue manager can be rewritten using a state machine approach to handle the following intents:

  • greet
  • ask_name
  • get_time
  • goodbye
// Define the state machine
const stateMachine = {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@debashisbarman
debashisbarman / nvmCommands.js
Created March 9, 2021 15:53 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
@debashisbarman
debashisbarman / forwardport.sh
Created May 15, 2020 10:43 — forked from Bostonncity/forwardport.sh
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@debashisbarman
debashisbarman / HTML.md
Created May 27, 2018 13:11
HTML, CSS and JS

Hypertext Markup Language (HTML)

Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications. HTML is the code that is used to structure a web page and its content. For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and tables. In this article we'll discuss all the concepts of HTML which will be enough to start any future web projects.

Read more

  1. https://en.wikipedia.org/wiki/HTML
  2. https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/HTML_basics

Core Concepts

# initialization file (not found)
@debashisbarman
debashisbarman / semantic-layout.html
Created November 2, 2017 19:51 — forked from thomd/semantic-layout.html
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@debashisbarman
debashisbarman / api.js
Last active August 17, 2017 19:36
RESTful API for a Demo Model
const express = require('express');
const app = express();
const router = express.Router();
const host = '';
const port = '';
const user = '';
const password = '';
const database = '';