Skip to content

Instantly share code, notes, and snippets.

View gauravds's full-sized avatar
🚀
Focusing

Gaurav Sharma gauravds

🚀
Focusing
View GitHub Profile
@gauravds
gauravds / proxy.go
Last active March 26, 2025 11:55
Go proxy server
package main
import (
"bytes"
"encoding/json"
"flag"
"io"
"log"
"net/http"
"os"
@gauravds
gauravds / docker-compose.yaml
Last active November 30, 2024 15:12
hasura postgres local setup docker-compose.yaml
version: '3.6'
services:
postgres:
image: postgres
restart: always
platform: linux/amd64
ports:
- '5432:5432'
environment:
POSTGRES_PASSWORD: password
@gauravds
gauravds / 1_instruction.md
Created October 22, 2024 20:49
Adonis 5 data recovery script from previous data.
  1. First run this command into adonisJS => node ace data:migrate > output.txt
  2. You got output.txt with all commands that has to run. test this script on local system using backups of old and new, and finally you will get the exact order of execution regarding internal foreign key refernce.
  3. Now let's do this on production db. generate a temp db as source_db and run this command with ofcource change the actual db names(source_db and dest_db).

P.S.:: I know one branch which is accidentally deleted was const branchId = 345 on const mainTable = 'branches' write your init logic according to that.

@gauravds
gauravds / README.md
Created August 17, 2024 10:42 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@gauravds
gauravds / docker-compose.yml
Created June 19, 2024 05:42
espo crm docker compose
version: '3.8'
services:
mysql:
container_name: mysql-espo
image: mysql:8.0.28
command: --default-authentication-plugin=mysql_native_password
restart: always
platform: linux/amd64
environment:
@gauravds
gauravds / docker-compose.yml
Created February 8, 2024 21:52
docker-compose.yml for mac m1 pro
version: '3.1'
services:
redis:
image: redis:5-alpine
platform: linux/amd64
restart: unless-stopped
container_name: redis
ports:
- '6379:6379'
@gauravds
gauravds / sql_mode_set.sql
Last active February 2, 2024 13:19
sql mode to support ONLY_FULL_GROUP_BY by setting this `NO_ENGINE_SUBSTITUTION`
SELECT @@sql_mode;
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION';
-- other commands
SELECT @@sql_mode;
SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));
SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY';
@gauravds
gauravds / README.md
Created November 15, 2023 17:55
VSCode debugger for aws lambda (Sam) command for service.

Local AWS lambda service call via sam / aws sam cli, you can also attach debugger to VSCode via configuration settings.json

$ sam local invoke --profile=dev MyServiceName1 -e events/events-MyServiceName1.json -n env/env-MyServiceName1.json
@gauravds
gauravds / timeSlot.js
Last active October 30, 2023 13:34
Next Time Slot
const moment = require('moment')
/**
* Get time for next round off 10 minutes in epoch form.
* @returns { number } epoch time
*
* if time is 17:23:32 => 17:30:00
* if time is 17:53:32 => 18:00:00
* if time is 23 Oct, 2023 23:53:32 => 24 Oct, 2023 00:00:00
*/
function getNextTimeClickFor10Minutes() {
@gauravds
gauravds / fix.sql
Created April 29, 2023 11:01
SELECT list is not in GROUP BY clause and contains nonaggregated column 'db1.tables1.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
SHOW VARIABLES LIKE 'sql_mode';
SET global sql_mode = 'NO_ENGINE_SUBSTITUTION';