Skip to content

Instantly share code, notes, and snippets.

View nwaughachukwuma's full-sized avatar
🧶
Making stuff

Chukwuma Nwaugha nwaughachukwuma

🧶
Making stuff
View GitHub Profile
@nwaughachukwuma
nwaughachukwuma / default.md
Created July 9, 2025 22:02 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
GET v4_enrichmentsx/_search
{
"query": {
"bool": {
"filter": [
{
"terms": {
"FIELD": [ # 64000
"VALUE1",
"VALUE2"
@nwaughachukwuma
nwaughachukwuma / nyreFetch.ts
Created January 14, 2023 09:22
Nyre-Fetch is a simple Node.js wrapper built on top of node-fetch. It includes helper methods I find helpful and use in my projects.
import nodeFetch, { type RequestInit, type Response } from "node-fetch";
import type { AbortSignal } from "abort-controller";
const TEN_MEGABYTES = 1000 * 1000 * 10;
type StreamOptions = RequestInit & {
signal?: AbortSignal;
highWaterMark?: number;
};
export async function fetch(
@nwaughachukwuma
nwaughachukwuma / getVideoSnapshot.ts
Last active October 2, 2023 02:03
Get video frame preview (snapshot) from video element
type EventDef<D> = Event & { detail?: D }
type VideoRef = string | HTMLVideoElement | null
const eventName = 'image-updated'
export default function getVideoSnapshot(videoRef: VideoRef) {
if (typeof videoRef === 'string') {
videoRef = document.getElementById(videoRef) as HTMLVideoElement | null
}
if (!videoRef) {
throw new Error('Video element not found')
@nwaughachukwuma
nwaughachukwuma / compressImage.ts
Last active January 14, 2023 04:27
Compress any image file before upload using imageBitmap and canvas
// See compatibility table for .toBlob() Method
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#browser_compatibility
interface Option {
type: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/bmp' | 'image/gif';
quality?: number;
}
async function compressImage(file: File, option: Option) {
if (!file.type.startsWith('image')) {
@nwaughachukwuma
nwaughachukwuma / deploy-docker-image-to-cloud-run.md
Last active September 22, 2022 16:59
Seven easy steps to deploy a docker image to cloud run [for pros]
  1. Build the image from a Dockerfile
    1. docker build ./ --tag {name}:latest. Advisable to use your service name here
  2. Test if the application is running
    1. docker run -p 8080:8080 -it name
    2. docker run -p 8080:8080 -e ENV=VALUE -it name
      1. e.g. docker run -p 8080:8080 -e PORT=8080 -it name
  3. Configure docker on GCloud CLI
    1. gcloud auth configure-docker gcr.io
    2. gcloud auth configure-docker {region}.gcr.io
  4. Enable cloud-run if it isn’t enabled, using cloud console or GCloud CLI
We couldn’t find that file to show.
@nwaughachukwuma
nwaughachukwuma / cheatsheet-elasticsearch.md
Created March 23, 2020 05:04 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@nwaughachukwuma
nwaughachukwuma / recoupFunds.ts
Last active December 26, 2019 08:16
This is used to recoup funds from an integrated business
import {stripe, StripeConfig} from './stripe-util'
/**
* Used to charge vendor's accounts on Stripe such as payment for a service
*/
export async function chargeConnectedAccount(source: string, amount: number, description: string, metadata: any = {}) {
const cost = Math.round(amount * 100)
const descriptor = 'transaction descriptor'