Skip to content

Instantly share code, notes, and snippets.

View cayter's full-sized avatar
🎯
Focusing

cayter cayter

🎯
Focusing
View GitHub Profile
@cayter
cayter / repository.ts
Last active June 11, 2024 22:51
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@cayter
cayter / index.cjs
Created July 13, 2023 12:41
drizzle-kit
This file has been truncated, but you can view the full file.
#!/usr/bin/env node
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
@cayter
cayter / main.go
Last active July 12, 2020 10:47
Rapyd's Go Example
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"io/ioutil"
@cayter
cayter / rapyd.js
Created March 17, 2020 13:46
Rapyd API - NodeJS 12.x Example
const https = require("https");
const crypto = require("crypto");
const accessKey = "<YOUR_RAPYD_ACCESS_KEY>";
const secretKey = "<YOUR_RAPYD_SECRET_KEY>";
const salt = crypto.randomBytes(12).toString("hex");
const timestamp = (Math.floor(new Date().getTime() / 1000) - 10).toString();
const method = "post";
const path = "/v1/payments";
const body = JSON.stringify({
@cayter
cayter / rapyd.mjs
Created March 17, 2020 13:44
Rapyd API - NodeJS 13.x Example
import https from "https";
import crypto from "crypto";
const accessKey = "<YOUR_RAPYD_ACCESS_KEY>";
const secretKey = "<YOUR_RAPYD_SECRET_KEY>";
const salt = crypto.randomBytes(12).toString("hex");
const timestamp = (Math.floor(new Date().getTime() / 1000) - 10).toString();
const method = "post";
const path = "/v1/payments";
const body = JSON.stringify({