Skip to content

Instantly share code, notes, and snippets.

View Dev-Dipesh's full-sized avatar

Dipesh Bhardwaj Dev-Dipesh

  • The Contentment Foundation
  • San Francisco, California
View GitHub Profile
@Dev-Dipesh
Dev-Dipesh / erasure_icons.json
Created March 29, 2025 22:12
Minified JSON of Erasure.io icons
{"AWS Icons":["ws-athena","aws-cloudsearch","aws-emr","aws-finspace","aws-kinesis","aws-kinesis-data-analytics","aws-kinesis-data-streams","aws-kinesis-firehose","aws-kinesis-video-streams","aws-managed-streaming-for-apache-kafka","aws-opensearch-service","aws-quicksight","aws-redshift","aws-data-exchange","aws-data-pipeline","aws-glue","aws-glue-databrew","aws-glue-elastic-views","aws-lake-formation","aws-api-gateway","aws-appflow","aws-eventbridge","aws-managed-workflows-for-apache-airflow","aws-mq","aws-simple-notification-service","aws-simple-queue-service","aws-appsync","aws-console-mobile-application","aws-express-workflows","aws-step-functions","aws-managed-blockchain","aws-quantum-ledger-database","aws-alexa-for-business","aws-chime","aws-chime-sdk","aws-chime-voice-connector","aws-connect","aws-honeycode","aws-pinpoint","aws-pinpoint-apis","aws-simple-email-service","aws-workdocs","aws-workdocs-sdk","aws-workmail","aws-application-cost-profiler","aws-billing-conductor","aws-budgets","aws-cost-and-usa
@Dev-Dipesh
Dev-Dipesh / Erasure_guide3.md
Created March 29, 2025 22:07
English-translated Eraser Guide

EraserAI Code Explanation - Practical Use Cases

EraserAI is a very handy tool that generates visual diagrams from natural language or code snippets! In this explanation, we'll walk through how to create easy-to-understand diagrams using EraserAI, in a way that's easy for beginners to grasp.

Cloud Architecture (AWS Visualization)

file

// Let's represent a simple data pipeline in AWS
@Dev-Dipesh
Dev-Dipesh / Eraser_Guide_2_EN.md
Created March 29, 2025 21:58
English-translated Eraser Guide

Eraser Notation Guide②

Entity-Relationship Diagram (ERD)

Eraser also provides notation for creating Entity-Relationship Diagrams (ERD). An ERD is a diagram used to visually represent the structure of a database.

ERD Notation

ERD notation is similar to regular diagram notation, but uses some special attributes and relationship types to represent entities and relationships.

@Dev-Dipesh
Dev-Dipesh / Eraser_Guide_1_EN.md
Created March 29, 2025 21:04
English-translated Eraser Guide

Eraser Notation Guide ①

Eraser is a documentation and diagram platform for engineering teams. It uses a unique notation to create visually expressive documents. This guide explains Eraser's notation in detail and demonstrates how to use it with various examples.

Basic Syntax

Eraser's notation uses a concise syntax similar to YAML. The basic syntax is written as follows:

// Node definition
@Dev-Dipesh
Dev-Dipesh / blockchain.md
Created March 22, 2025 04:31
Simple Test Code for Creating Blockchain + Basic AI Fraud Detection

Simple Test Code for Creating Blockchain + Basic AI Fraud Detection

import hashlib
import time

class Block:
  def __init__(self, index, previous_hash, timestamp, transactions):
    self.index = index # Block number
    self.previous_hash = previous_hash # Hash of the previous block
@Dev-Dipesh
Dev-Dipesh / code.gs
Last active December 1, 2024 05:13
Turning Zomato Order History into Insights: A Personal Project
// This is the main code that processes the raw data from the 'Raw Data' sheet and places it in 'Formatted Data' sheet.
function processRawData() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var rawSheet = sheet.getSheetByName('Raw Data'); // Raw data arrives here from Zapier
var formattedSheet = sheet.getSheetByName('Formatted Data'); // Formatted data is posted here after processing
// Get the data from the Raw Data sheet
var rawData = rawSheet.getDataRange().getValues();
for (var i = 1; i < rawData.length; i++) { // Start from row 1 to skip headers
@Dev-Dipesh
Dev-Dipesh / image.md
Last active May 10, 2024 07:10
Javascript loops can be quite confusing. Knowing the write loop to use can make a big difference in performance.

A4 Image file if you would like to print it ♥ JS Loops Cheatsheet

@Dev-Dipesh
Dev-Dipesh / google-cloud-spanner-true-time.md
Created April 27, 2024 09:27
Google Cloud Spanner Transaction Commit Explanation with an Example

Google Cloud Spanner Transaction Commit using True Time API

Mermaid Diagram

Imagine you're organizing a surprise party (a transaction) that needs to happen precisely at 5 PM (the commit time). However, all your friends (the database nodes) have slightly different watches, and you can't trust them to be perfectly synchronized. To avoid the surprise being ruined by someone arriving early or late, you decide to use a special app (TrueTime) that allows everyone to agree on a time window when 5 PM will definitely occur, say between 4:59 PM and 5:01 PM.

You tell your friends to be ready and in position anytime within that window, but the surprise will only start exactly at 5 PM, as determined by the app. Because of the app's accuracy, you're confident that no one will act before 4:59 PM or after 5:01 PM, and since everyone prepares in advance, the party kicks off flawlessly at 5 PM without further coordination needed. This is akin to how Spanner uses TrueTime to set a global commit timestamp that ensures all

CleanShot 2024-04-26 at 21 05 31@2x

Hack for the Game

Remember to change the query selector before running the script in your browser.

Laymen Explanation

  • Game Character = sleeping emoji
  • Obstacle = Notification emoji

Here's what each part of the code does:

@Dev-Dipesh
Dev-Dipesh / seed.ts
Last active April 18, 2024 13:58
Project: Evento
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const events = [
{
id: 1,
name: "DJ Practice Session",
slug: "dj-practice-session",
city: "Austin",