Skip to content

Instantly share code, notes, and snippets.

View anishkumar127's full-sized avatar
πŸ¦‹
EatπŸ˜‹ | Code πŸ‘¨β€πŸ’»| Sleep 😴 | Repeat ♾️ | Achieve πŸš€

Anish Kumar anishkumar127

πŸ¦‹
EatπŸ˜‹ | Code πŸ‘¨β€πŸ’»| Sleep 😴 | Repeat ♾️ | Achieve πŸš€
View GitHub Profile
@tailwiinder
tailwiinder / .cursorrules
Created April 27, 2025 09:26
cursorrules for using cursor as your AI coding tutor, enabling you to learn and discover programming concepts
- **Role**: Act as a coding tutor dedicated to helping me learn to code deeply and independently.
- **Code Writing**:
- Do not write complete code for me unless I explicitly request it.
- Instead, provide detailed explanations, hints, and partial solutions (e.g., pseudocode or code skeletons) to guide me in writing the code myself.
- **Teaching Approach**:
- Focus on teaching underlying concepts and first principles (e.g., for loops, explain iteration, its purpose, and how it controls flow).
- Break down complex topics into simpler, fundamental components.
- Connect new ideas to basic concepts I already know to build a strong foundation.
- **Nuanced Questions**:
- Suggest thought-provoking questions for me to research or ask back, such as:

If it's so easy to guess a uuid, here you go

I ran crypto.randomUUID() twice on my machine.

The first ID was 15041508-fd38-4eda-bc1d-7b74e4738cd9

The second? That's your challenge.

I encrypted a text file with the following command:

@cmackenzie1
cmackenzie1 / updated_at.sql
Created January 31, 2025 16:16
PostgreSQL Updated at column trigger
-- Function to automatically update the updated_at column
CREATE OR REPLACE FUNCTION update_updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
-- Apply the trigger to all tables with an updated_at column
@sagar285
sagar285 / gist:3f7542d13606dee3b525e3315b46d453
Last active June 15, 2025 17:22
aws deployment on instanc
Steps to deploy a Node.js app to aws using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
## 1. Create Free AWS Account
Create free AWS Account at https://aws.amazon.com/
## 2. Create and Lauch an EC2 instance and SSH into machine
I would be creating a t2.medium ubuntu machine for this demo.
## 3. Install Node and NPM
```
@chandelabhishek
chandelabhishek / aggrgate-query.js
Last active January 19, 2025 14:31
batch queries and run it in a single transaction - postgres, nodejs, knex
const pgp = require('pg-promise')();
pgp.pg.types.setTypeParser(20, parseInt);
function AggregateQuery(queryBuilders) {
// pass in a knex transaction
async function run(transaction) {
const queries = queryBuilders.map(qb => {
const { sql: query, bindings: values } = qb.toSQL().toNative();
return { query, values };
});
import {Router} 'express'
import {auth, logged} from 'actions/auth'
import {list, show} from 'actions/users'
import {render} from 'actions/common'
export default const router = Router()
router.use(auth)