Skip to content

Instantly share code, notes, and snippets.

View drifterz13's full-sized avatar

Totsawat.M drifterz13

  • Bangkok, TH
View GitHub Profile
@drifterz13
drifterz13 / check-lib.ts
Created November 27, 2025 10:50
Script to check npm package that was published during Shai-Hulud 2.0 attack timeframe (November 21-24, 2025).
import { parseArgs } from "util";
import fs from "fs";
const { values } = parseArgs({
args: Bun.argv,
options: {
path: {
type: "string",
},
},
enum Gender {
MALE
FEMALE
OTHER
}
enum CreditSource {
INTERNAL
EXTERNAL
}
@drifterz13
drifterz13 / starship.toml
Last active August 13, 2024 09:41
base starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '❯' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
@drifterz13
drifterz13 / openai-assistant-node.ts
Last active June 5, 2024 19:08
Node.js + OpenAI assistant example
require('dotenv').config()
import OpenAI from 'openai'
import fs from 'fs'
import path from 'path'
import { MessageContentText } from 'openai/resources/beta/threads/messages/messages'
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
})
<html>
<head></head>
<body>
<title></title>
<style type="text/css">
#outlook a {
padding: 0;
}
body {
margin: 0;