Skip to content

Instantly share code, notes, and snippets.

View bdcorps's full-sized avatar
🎯
Focusing

Sukhpal Saini bdcorps

🎯
Focusing
View GitHub Profile
import { Customers } from '@/components/llm-stocks';
import { createAI, getMutableAIState, render } from 'ai/rsc';
import { OpenAI } from 'openai';
import { z } from 'zod';
import { Stripe } from "stripe";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
export const config = {
matcher: [
"/((?!_next|fonts|examples|api|[\\w-]+\\.\\w+).*)",
],
};
@bdcorps
bdcorps / docker-compose.yml
Created November 22, 2021 02:36
Docker Compose Configuration for Portainer CE
version: "3"
services:
portainer:
image: portainer/portainer-ce:2.9.3-alpine
volumes:
- /var/portainer:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "9000:9000"
@bdcorps
bdcorps / Dockerfile
Last active November 21, 2021 14:54
Dockerfile for Next.js project
# Adapted from https://nextjs.org/docs/deployment
FROM node:16-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json ./
RUN npm install
FROM node:16-alpine AS builder
WORKDIR /app
worker_processes 1;
events { worker_connections 1024; }
http {
server {
server_name www.saasbase.dev;
return 301 $scheme://saasbase.dev$request_uri;
}
@bdcorps
bdcorps / trigger-zapier.js
Last active November 16, 2021 00:24
Trigger Zapier Webhook from Node.js
// using axios
const axios = require('axios');
export const notifyWebhook = async (url, body) => {
const res = await axios
.post(url, body, {
Accept: "application/json",
"Content-Type": "application/json"
})
}
@bdcorps
bdcorps / coinbase-api-key.js
Last active March 2, 2022 14:52
API Documentation - Coinbase for Node.js
const express = require("express");
const axios = require('axios');
const crypto = require('crypto');
const app = express();
const API_KEY = "";
const API_SECRET = "";
app.use(express.json());
@bdcorps
bdcorps / coinbase-api-key.py
Last active November 12, 2021 17:00
Access Coinbase API using an API Key/Secret with Python 3
# Updates Python 2 code sample here to Python3: https://developers.coinbase.com/docs/wallet/api-key-authentication
# Requires python-requests. Install with pip:
#
# pip install requests
#
# or, with easy-install:
#
# easy_install requests
import json, hmac, hashlib, time, requests
@bdcorps
bdcorps / coinbase-oauth2.js
Last active April 4, 2023 22:36
API Documentation - Coinbase OAuth2 for Node.js
const express = require("express");
const axios = require('axios');
const qs = require('qs');
const app = express();
const CLIENT_ID = "";
const CLIENT_SECRET = "";
// should match the value in the button URL
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Location Plotter</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>