Skip to content

Instantly share code, notes, and snippets.

View ashutoshpw's full-sized avatar
:octocat:
Helping people to convert their Ideas into Reality

Ashutosh Kumar ashutoshpw

:octocat:
Helping people to convert their Ideas into Reality
View GitHub Profile
@ashutoshpw
ashutoshpw / BasePrompt.txt
Last active February 7, 2024 19:26
GPT 4 Prompt
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture.
Current date: 2024-02-08
Image input capabilities: Enabled
# Tools
## python
When you send a message containing Python code to python, it will be executed in a
@ashutoshpw
ashutoshpw / app-review.model.js
Created July 23, 2023 22:33
App Review Model
const mongoose = require('mongoose')
const { toJSON, paginate, customTimeStamp } = require('./plugins');
const reviewSchema = new mongoose.Schema({
app_name: {
type: String,
},
app_id: {
type: String,
required: true,
@ashutoshpw
ashutoshpw / database.sql
Created September 17, 2022 13:49
message-app
CREATE TABLE users (
id INT,
status VARCHAR,
email VARCHAR NOT NULL,
username VARCHAR NOT NULL,
created_at DATETIME NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE messages (
@ashutoshpw
ashutoshpw / Code.gs
Last active September 7, 2022 12:56
Google Sheets - Format time in format "2.50 - 3.00"
function processTimeString(time, isPostLunch){
time = time.trim().replace(".",":") + ":00"
const timeParts = time.split(":")
if(parseInt(timeParts[0]) < 12 && isPostLunch) time = `${(parseInt(timeParts[0])+12)}:${timeParts[1]}:${timeParts[2]}`
if(time.split(":")[0].length == 1) time = "0" + time;
return time
}
function processTime(time, isStart = true, isPostLunch = false){
@ashutoshpw
ashutoshpw / GitpodCommunity_2022-05-22.yaml
Last active May 21, 2022 22:50
Gitpod Self Hosted - Resources
apiVersion: kots.io/v1beta1
kind: License
metadata:
name: community
spec:
appSlug: gitpod
channelID: 259YYBILXTa30S1Soli9YcWcPTb
channelName: Stable
customerName: Community
endpoint: 'https://replicated.app'
@ashutoshpw
ashutoshpw / deno-test.js
Created September 29, 2021 08:29
deno-test.js
import { MongoClient } from "https://deno.land/x/mongo@v0.22.0/mod.ts";
const URI = "mongodb://127.0.0.1:27017";
addEventListener("fetch", async (event) => {
const client = new MongoClient();
try {
await client.connect(URI);
console.log("Database successfully connected");
} catch (err) {
@ashutoshpw
ashutoshpw / docker-compose.yml
Created September 12, 2021 19:27
nextcloud-docker
version: "2.1"
services:
nextcloud:
image: nextcloud
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Kolkata
@ashutoshpw
ashutoshpw / country_phone.json
Created January 20, 2021 10:25
country_phone.json
[
{
"code": "+7 840",
"name": "Abkhazia"
},
{
"code": "+93",
"name": "Afghanistan"
},
{
@ashutoshpw
ashutoshpw / db.js
Created December 22, 2020 19:10
ConnectToMySQLFromAWSLambda
'use strict';
const mysql = require('mysql'); // require mysql
// If 'client' variable doesn't exist
if (typeof client === 'undefined') {
// Connect to the MySQL database
var client = mysql.createConnection({
// your connection info
@ashutoshpw
ashutoshpw / .htaccess
Last active August 3, 2020 07:00
apache-htaccess-reverese-proxy
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:8000/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:8000/$1 [P,L]