Skip to content

Instantly share code, notes, and snippets.

View nyck33's full-sized avatar
Working from home

N. YC. Kim nyck33

Working from home
View GitHub Profile
nyck33 /
Created June 2, 2024 12:22
FastAPI server zitified
from fastapi import FastAPI, HTTPException, Response, UploadFile, Form, Depends, Request
from fastapi.responses import JSONResponse
import json
import zipfile
import io
from dotenv import load_dotenv
import os
from supabase import create_client
from schemas import AuthDetails, DebugQuery, DebugResponse
from fastapi.staticfiles import StaticFiles
nyck33 / lesson17Applicative.hs
Created May 21, 2024 02:17
Will Kurt Get Programming in Haskell, use Applicatives for Lesson 17 exercises.
Makes the code much simpler than using cycle and other methods for Cartesian sums
module PTableApplicative where
import Control.Applicative (liftA2)
type Events = [String]
type Probs = [Double]
nyck33 /
Created April 5, 2024 08:38
llvm issue for mlir
(mlir-py39cuda12) nyck33@lenovo-gtx1650:/mnt/d/LLVM/NewPolygeistDir/llvm-project/mlir/test/INtegration/GPU/Cuda/TensorCore$ mlir-opt wmma-matmul-f16.mlir | mlir-opt -test-lower-to-nvvm="cubin-chip=sm_75 cubin-format=cubin" | mlir-cpu-runner --shared-libs=$MLIR_CUDA_RUNTIME --shared-libs=$MLIR_RUNNER_UTILS --entry-point-result=void
<stdin>:1:1: error: Invalid format specified.
module {
<stdin>:1:1: note: see current operation: 
"builtin.module"() ({
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<ptr (i64)>, linkage = #llvm.linkage<external>, sym_name = "malloc", visibility_ = 0 : i64}> ({
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void ()>, linkage = #llvm.linkage<external>, sym_name = "main", visibility_ = 0 : i64}> ({
nyck33 / catMovesInSquareMeowsAtCorners.json
Created February 25, 2024 15:18
"targets": [
"isStage": true,
"name": "Stage",
"variables": {
"`jEk@4|i[#Fk?(8x)AV.-my variable": [
"my variable",
nyck33 / gist:0f4d93fe47a652c3c001dc1308c81234
Created January 12, 2024 12:37
Langchain querying vector database of Korean textbook, not working, code works for English text
from langchain.document_loaders import TextLoader
from langchain_google_genai import ChatGoogleGenerativeAI, GoogleGenerativeAIEmbeddings
from langchain.prompts import PromptTemplate
from langchain.vectorstores import FAISS
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.chains import LLMChain
from dotenv import load_dotenv
import os
nyck33 /
Created November 30, 2023 11:06
Snowflake Data Engineering Stored Procedure error
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/05_fahrenheit_to_celsius_udf (main) $ snow procedure execute -p "orders_update_sp()"
Error executing sql:
use role HOL_ROLE;
use warehouse HOL_WH;
use database HOL_DB;
use schema ANALYTICS;
call orders_update_sp();
002140 (42601): SQL compilation error:
nyck33 /
Created November 17, 2023 01:30
Monitor Ubuntu logs for errors
import re
import subprocess
from time import sleep
log_file_path = '/var/log/syslog'
check_interval = 60 # in seconds
def notify(message):
subprocess.Popen(['notify-send', message])
nyck33 /
Created November 4, 2023 02:33
sqlite dump file for OWASP Juice Shop with errors following when I try to
-- PRAGMA foreign_keys=OFF; (Commented out for PostgreSQL)
CREATE TABLE "Users" ("id" SERIAL PRIMARY KEY, "username" VARCHAR(255) DEFAULT '', "email" VARCHAR(255), "password" VARCHAR(255), "role" VARCHAR(255) DEFAULT 'customer', "deluxeToken" VARCHAR(255) DEFAULT '', "lastLoginIp" VARCHAR(255) DEFAULT '', "profileImage" VARCHAR(255) DEFAULT '/assets/public/images/uploads/default.svg', "totpSecret" VARCHAR(255) DEFAULT '', "isActive" BOOLEAN DEFAULT TRUE, "createdAt" TIMESTAMP NOT NULL, "updatedAt" TIMESTAMP NOT NULL, "deletedAt" TIMESTAMP);
INSERT INTO Users VALUES(1,'','admin@juice-sh.op','0192023a7bbd73250516f069df18b500','admin','','','assets/public/images/uploads/defaultAdmin.png','',1,'2023-10-29 08:53:20.984 +00:00','2023-10-29 08:53:20.984 +00:00',NULL);
INSERT INTO Users VALUES(2,'','jim@juice-sh.op','e541ca7ecf72b8d1286474fc613e5e45','customer','','','assets/public/images/uploads/default.svg','',1,'2023-10-29 08:53:20.984 +00:00','2023-10-29 08:53:20.984 +00:00',NULL)
nyck33 / gist:18fc5362ea88731d98ef4db232ccdf08
Created September 27, 2023 07:49
autopsy install error messages.log
>Log Session: Wednesday, September 27, 2023 at 4:45:21 PM Korean Standard Time
>System Info:
Product Version = Autopsy 4.21.0
Operating System = Linux version 6.2.0-33-generic running on amd64
Java; VM; Vendor =; OpenJDK 64-Bit Server VM; Private Build
Runtime = OpenJDK Runtime Environment
Java Home = /usr/lib/jvm/java-17-openjdk-amd64
System Locale; Encoding = en_US (autopsy); UTF-8
Home Directory = /home/nyck33