Skip to content

Instantly share code, notes, and snippets.

View cyai's full-sized avatar

Vardhaman cyai

View GitHub Profile
@cyai
cyai / gitignore
Created February 26, 2024 21:40
standard .gitignore file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@cyai
cyai / nodejs-Dockerfile
Created February 27, 2024 10:38
standard Dockerfile for nodejs application
# syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.9.0
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="Node.js"
# Node.js app lives here
WORKDIR /app
@cyai
cyai / knight_move.rs
Created April 14, 2024 11:34
This program implements the backtracking algorithm to solve the Knight's Tour problem on a chessboard.
use std::env;
use std::process::Command;
use std::time::Duration;
use std::{thread, vec};
fn print_board(size_x: i32, _size_y: i32, board: &Vec<Vec<i32>>) {
println!("Knight's Tour Problem");
println!("Chess Board:");
print!(" ");
for _ in 0..size_x {
@cyai
cyai / model.py
Created October 29, 2024 11:52
Model file for SenseVoice SRT model
import time
import torch
from torch import nn
import torch.nn.functional as F
from typing import Iterable, Optional
from funasr.register import tables
from funasr.models.ctc.ctc import CTC
from funasr.utils.datadir_writer import DatadirWriter
@cyai
cyai / run_ngrok.sh
Created November 8, 2024 17:52
Ngrok run in background and extract the ngrok public url
#!/bin/sh
# Set local port from command line arg or default to 8080
LOCAL_PORT=${1-8080}
echo "Start ngrok in background on port [ $LOCAL_PORT ]"
nohup ngrok http ${LOCAL_PORT} &>/dev/null &
echo -n "Extracting ngrok public url ."
NGROK_PUBLIC_URL=""
@cyai
cyai / ngrok_tcp.sh
Created December 25, 2024 05:47
Run ngrok tcp connection in background and get the public url
#!/bin/sh
LOCAL_PORT=${1-10000}
echo "Starting ngrok in the background on TCP port [ $LOCAL_PORT ]"
nohup ngrok tcp ${LOCAL_PORT} &>/dev/null &
echo -n "Extracting ngrok public URL for TCP ."
NGROK_PUBLIC_URL=""
while [ -z "$NGROK_PUBLIC_URL" ]; do