Skip to content

Instantly share code, notes, and snippets.

View sambhav2612's full-sized avatar
👋
Building Suitable AI

Sambhav Jain sambhav2612

👋
Building Suitable AI
View GitHub Profile
@sambhav2612
sambhav2612 / module.ts
Created July 6, 2022 14:13
nestjs bull queue
BullModule.registerQueue({
name: 'applicant',
}),
<?php
/*
* Template Name: Page Slack Integration
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
@sambhav2612
sambhav2612 / gist:19b30fd78ddc2b0c27b786b4cb3931f2
Created November 26, 2021 09:06 — forked from spudbean/gist:1558257
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons
Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.
[
{
"Id":"…",
"RepoTags":[
"…"
],
"RepoDigests":[
"…"
],
"Parent":"",
@sambhav2612
sambhav2612 / regex_test.js
Last active October 15, 2020 09:22
regex to check for iso date strings under ''
console.log(new Date().toISOString().match(/('((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)')/g).length > 0);
@sambhav2612
sambhav2612 / gist:64534b40d997380ed467c5c2927451a7
Created September 8, 2020 19:31 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
/**
*
* @typedef {{Cart: Object, AccessToken: String}} CartAndAccessToken
*
* @module addProductToCart - API to add product to active cart and create and add if not present.
* @param {String} product - the ID of product to add to cart (required)
* @param {Number} quantity - the quantity of product to add to cart (required)
*
* @returns {CartAndAccessToken}
*/
@sambhav2612
sambhav2612 / service.ts
Created August 23, 2020 08:21
a service method to fetch data based on query filters and user subscription while maintaining past search records
async fetch(user: any, query: string, search: boolean): Promise<any> {
const subscription = await this.subscriptionService.findOneByUser(user && user.id);
if (subscription && subscription.isActive) {
const searchRecords = await this.searchService.getForUser(user && user.id);
const todaySearchRecords = searchRecords.filter(ele => new Date(ele.createdAt).toDateString() === new Date().toDateString());
const flag = todaySearchRecords.length < subscription.searchLimit;
if ((flag && search) || !search) {
let records = await getManager().query(query);
https://ide.geeksforgeeks.org/vBYH0dzeP3