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:
- **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:
-- 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 |
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 | |
``` |
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) |