Cmd/Ctrl + k, Cmd/Ctrl + 0
Cmd/Ctrl + k, Cmd/Ctrl + -
| // Define the async function with TypeScript | |
| async function mockApiCall(delay: number): Promise<string> { | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve('Mock API call completed'); | |
| }, delay); | |
| }); | |
| } | |
| // Example usage |
| # Prints out pid | |
| sudo lsof -i :5432 | |
| kill -9 <PID> |
| { | |
| "uuid": { | |
| "prefix": "uuid", | |
| "body": [ | |
| "\"$UUID\"" | |
| ], | |
| "description": "Insert a UUID v4 id", | |
| } | |
| } |
| { | |
| "PrintF": { | |
| "prefix": "prf", | |
| "body": [ | |
| "fmt.Printf(\"\\n $1 %$2 \\n\", $1);", | |
| ], | |
| "description": "fmt.Printf" | |
| }, | |
| "PrintLn": { | |
| "prefix": "prln", |
| # Load Data | |
| data = read.csv(file.choose()) | |
| # Basic Analysis | |
| head(data) | |
| tail(data) | |
| str(data) | |
| colnames(data) | |
| summary(data) | |
| class(data) |
| # Import Data | |
| data=read.csv(file.choose(),na.strings = c("","NA")) | |
| # head, tail, str, colnames, summary | |
| head(data) | |
| tail(data) | |
| str(data) | |
| colnames(data) | |
| summary(data) |
| const fs = require("fs"); | |
| const myData = [...Add your data here]; | |
| const final = myData.map((item, index) => { | |
| return { | |
| // Add your object data here which goes into seeder | |
| }; | |
| }); |
| // Example array | |
| let ar = [10, 20, 20, 10, 10, 30, 50, 10, 20]; | |
| // Count object | |
| const countObject = ar.reduce((acc, curr) => { | |
| if (acc[curr]) { | |
| return { | |
| ...acc, | |
| [curr]: acc[curr] + 1 | |
| } |