Skip to content

Instantly share code, notes, and snippets.

@5minslearn
5minslearn / prepare-commit-msg
Last active October 8, 2022 12:31
Append name of the commiting user in prepare-commit-msg hook
#!/bin/sh
username=$(git config user.name)
echo "[$username]" > $1
@5minslearn
5minslearn / pass-pre-push
Last active October 8, 2022 13:37
Make pre-push hook pass
#!/bin/sh
exit 0
@5minslearn
5minslearn / fail-pre-push
Created October 8, 2022 13:29
Make pre-push hook fail
#!/bin/sh
exit 1
@5minslearn
5minslearn / package.json
Created October 8, 2022 15:58
Husky configuration in package.json file
{
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
mkdir Temp_PDF_Files # Create new directory
cp ./*.pdf Temp_PDF_Files/ # Copy pdf files to Temp_PDF_Files directory
@5minslearn
5minslearn / git_installation_and_configuration_script.txt
Last active November 12, 2022 13:17
Git installation and Configuration Script
# Install Git
sudo apt-get update
sudo apt-get -y install git
# Configure Git with your name and email
git config --global user.name "your_name"
git config --global user.email "your_email"
import amqp from "amqplib";
const queue = "product_inventory";
const text = {
item_id: "macbook",
text: "This is a sample message to send receiver to check the ordered Item Availablility",
};
(async () => {
let connection;
import amqp from "amqplib";
const queue = "product_inventory";
(async () => {
try {
const connection = await amqp.connect("amqp://localhost");
const channel = await connection.createChannel();
process.once("SIGINT", async () => {
@5minslearn
5minslearn / event_schedule_data.json
Created July 9, 2023 17:03
Event Schedule Sample Data
{
"examples": [
{
"id": "ca-1",
"content": "Schedule a calendar event in Teak oaks HOA about competitions happening tomorrow",
"annotations": [
{
"start": 0,
"end": 7,
"tag_name": "action"
# This is an auto-generated partial config. To use it with 'spacy train'
# you can run spacy init fill-config to auto-fill all default settings:
# python -m spacy init fill-config ./base_config.cfg ./config.cfg
[paths]
train = null
dev = null
vectors = "en_core_web_lg"
[system]
gpu_allocator = null