Skip to content

Instantly share code, notes, and snippets.

View neuwcodebox's full-sized avatar
๐Ÿค”
Thinking

Neuw15611cbox neuwcodebox

๐Ÿค”
Thinking
  • South Korea
  • 19:11 (UTC +09:00)
View GitHub Profile
@neuwcodebox
neuwcodebox / index.js
Created April 3, 2025 01:45
Embedding API Benchmark
const URL = 'http://localhost:7003/embed/';
const PAYLOAD = JSON.stringify({ sentences: ['Hello World!'] });
const HEADERS = { 'Content-Type': 'application/json' };
const CONCURRENT_REQUESTS = 10; // ๋™์‹œ ์š”์ฒญ ๊ฐœ์ˆ˜
const TOTAL_REQUESTS = 100; // ์ด ์š”์ฒญ ๊ฐœ์ˆ˜
async function measureLatency() {
let times = [];
for (let i = 0; i < TOTAL_REQUESTS; i++) {
let start = performance.now();
@neuwcodebox
neuwcodebox / register warp menu.reg
Created February 28, 2025 13:43
Windows context menu for the Warp terminal
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Warp]
"Icon"="C:\\Users\\{{USER NAME}}\\AppData\\Local\\Programs\\Warp\\warp.exe"
@="Warp์—์„œ ์—ด๊ธฐ"
[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Warp\command]
@="\"C:\\Users\\{{USER NAME}}\\AppData\\Local\\Programs\\Warp\\warp.exe\" \"file://%V\""
@neuwcodebox
neuwcodebox / index.js
Created January 18, 2023 14:14
Google Drive API - List folders and download images inside
import { google } from 'googleapis';
import * as fs from 'fs';
function authGoogleApi() {
let auth = new google.auth.GoogleAuth({
keyFile: './service-account.json',
scopes: [
'https://www.googleapis.com/auth/drive.readonly',
],
});
@neuwcodebox
neuwcodebox / video.py
Created August 15, 2020 07:19
์ด๋ฏธ์ง€ ์‹œํ€€์Šค๋ฅผ ffmpeg๋กœ YouTube์šฉ ์˜์ƒ์œผ๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ. (720p)
import os
from os import walk
list_file = "img_paths.txt"
for (_, _, filenames) in walk("img"):
with open(list_file, "w") as f:
f.writelines(map(lambda name: f"file img/{name}\n", filenames))
break
@neuwcodebox
neuwcodebox / kma-radar.py
Created August 5, 2020 13:35
๋‚ ์”จ๋ˆ„๋ฆฌ ๋ ˆ์ด๋” ์˜์ƒ ํฌ๋กค๋ง
import urllib.request
from datetime import datetime, timedelta
import time
tm = datetime(2020, 8, 5, 22, 00) # ์ด ์‹œ์ ๋ถ€ํ„ฐ ๊ณผ๊ฑฐ๋กœ ๊ฐ€๋ฉด์„œ ์–ป์Œ.
while True:
tm_str = tm.strftime("%Y%m%d%H%M")
url = f"https://www.weather.go.kr/w/cgi-bin/rdr_new/nph-rdr_sat_lgt_img_v3?tm={tm_str}&sat=ir1&rdr=lng&map=HC&size=640&zoom_level=0&zoom_x=0000000&zoom_y=0000000&fog=0"
print(tm_str)
try:
@neuwcodebox
neuwcodebox / Program.cs
Created June 25, 2020 13:16
Send a message to the FCM.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Net;
using System.IO;
using Google.Apis.Auth.OAuth2;
using Newtonsoft.Json;
@neuwcodebox
neuwcodebox / pews.py
Created May 4, 2020 11:21
๊ธฐ์ƒ์ฒญ ์‹ค์‹œ๊ฐ„ ์ง€์ง„ ๊ฐ์‹œ์—์„œ ๊ด€์ธก์†Œ ์ง„๋„ ๋ฐ์ดํ„ฐ๋งŒ ์–ป๋Š” ์˜ˆ์‹œ
import requests
import datetime
head_len = 4
station_cnt = 265 # ์›๋ž˜๋Š” s ํŒŒ์ผ์—์„œ ์–ป์–ด์™€์•ผํ•  ์ •๋ณด.
time_offset = 1000
time = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(milliseconds=time_offset)
bin_time = time.strftime('%Y%m%d%H%M%S')
@neuwcodebox
neuwcodebox / stereo-visualizer.rs
Created February 22, 2020 12:15
Stereo Visualizer
use ggez::{
audio::{self, SoundSource},
conf::{WindowSetup, WindowMode},
error::GameError,
event, graphics,
input::keyboard,
graphics::DrawParam,
Context, GameResult,
};
use rodio::Source;
@neuwcodebox
neuwcodebox / rule.rs
Created January 24, 2020 11:34
๊ทœ์น™ ์ฐพ๊ธฐ ๋ฌธ์ œ ํ’€๋‹ค๊ฐ€ ๋จธ๋ฆฌ๊ฐ€ ์ž˜ ์•ˆ ๋Œ์•„๊ฐ€์„œ ๋‡Œ ์ค€๋น„์šด๋™์œผ๋กœ ๋งŒ๋“ฆ.
use std::iter::FromIterator;
/// A rule for repositioning characters in a string.
struct Rule(Vec<usize>);
impl Rule {
/// Applies this rule to the input and returns the result.
///
/// # Examples
///
@neuwcodebox
neuwcodebox / Pews.cs
Last active May 3, 2020 12:21
๊ธฐ์ƒ์ฒญ ์‹ค์‹œ๊ฐ„ ์ง€์ง„ ๊ฐ์‹œ ํŽ˜์ด์ง€ ํฌ๋กค๋Ÿฌ.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Threading;
using System.Net.Http;
using System.Net;
using System.IO;