Skip to content

Instantly share code, notes, and snippets.

extern crate notify;
use notify::{Watcher as _};
use std::fs;
#[allow(unused_imports)]
use std::io::{self, Read as _};
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
@AnthoniG
AnthoniG / jarvo.rs
Created September 7, 2026 18:40 — forked from TwopTheCreator/jarvo.rs
A .jar to .rs converter
use std::fs::{self, File};
use std::io::{self, Read, Write, BufReader, BufRead};
use std::path::{Path, PathBuf};
use std::process::Command;
use zip::ZipArchive;
use zip::write::{ZipWriter, FileOptions};
/// Main structure for JAR to Rust conversion
pub struct Jarvo {
jar_path: PathBuf,
@AnthoniG
AnthoniG / mpsc.rs
Created September 7, 2026 18:36 — forked from jonhoo/mpsc.rs
use std::collections::VecDeque;
use std::sync::{Arc, Condvar, Mutex};
// Flavors:
// - Synchronous channels: Channel where send() can block. Limited capacity.
// - Mutex + Condvar + VecDeque
// - Atomic VecDeque (atomic queue) + thread::park + thread::Thread::notify
// - Asynchronous channels: Channel where send() cannot block. Unbounded.
// - Mutex + Condvar + VecDeque
// - Mutex + Condvar + LinkedList
@AnthoniG
AnthoniG / strsplit.rs
Created September 7, 2026 18:32 — forked from jonhoo/strsplit.rs
#![warn(rust_2018_idioms)]
#[derive(Debug)]
pub struct StrSplit<'haystack, D> {
remainder: Option<&'haystack str>,
delimiter: D,
}
impl<'haystack, D> StrSplit<'haystack, D> {
pub fn new(haystack: &'haystack str, delimiter: D) -> Self {
@AnthoniG
AnthoniG / deploy.yml
Created July 30, 2025 20:14 — forked from thecodeholic/deploy.yml
Github Actions Workflow
name: CloudaysDeploy
on:
push:
branches: [main]
# release:
# types: [created]
jobs:
@AnthoniG
AnthoniG / ResponsiveTable.vue
Created July 18, 2025 20:24
Responsive tables on mobile screens using TailwindCSS
<template>
<div class="p-5 h-screen bg-gray-100">
<h1 class="text-xl mb-2">Your orders</h1>
<div class="overflow-auto rounded-lg shadow hidden md:block">
<table class="w-full">
<thead class="bg-gray-50 border-b-2 border-gray-200">
<tr>
<th class="w-20 p-3 text-sm font-semibold tracking-wide text-left">No.</th>
<th class="p-3 text-sm font-semibold tracking-wide text-left">Details</th>
@AnthoniG
AnthoniG / tips.ts
Created July 18, 2025 08:34 — forked from TomProBLD/tips.ts
TypeScript Tips
/**
* ---
* ---
* Partial, Pick, Omit and Required
* ---
* ---
*/
interface Props {
key1: string;
key2: number;
@AnthoniG
AnthoniG / pythonstartup.py
Created June 26, 2024 13:30 — forked from ksamuel/pythonstartup.py
Python startup script
import atexit
# First, a lot of imports. I don't use all of them all the time,
# but I like to have them available.
import csv
import datetime as dt
import hashlib
import json
import math
@AnthoniG
AnthoniG / curlget.cpp
Created March 14, 2024 04:44 — forked from whoshuu/curlget.cpp
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@AnthoniG
AnthoniG / .gitignore
Created March 11, 2024 15:04 — forked from evandrocoan/.gitignore
Simple C++ program example to run tests together with your code using doctest.
/build