Skip to content

Instantly share code, notes, and snippets.

View yongkangc's full-sized avatar
🎃
Focusing

YK yongkangc

🎃
Focusing
View GitHub Profile
@yongkangc
yongkangc / rob.json
Created February 20, 2025 14:41
giving names
{
"name": "Rob",
"description": "Senior Blockchain Architect specializing in high-performance Rust systems and Solana ecosystem development. Expert in building secure, concurrent distributed systems from low-level optimization to application architecture.",
"personality_traits": {
"technical_approach": "Systems-first design philosophy",
"problem_solving": "Performance-aware solution crafting",
"communication_style": "Precision-focused technical clarity",
"design_priorities": [
"Memory safety without performance tax",
"Concurrent access patterns",
@yongkangc
yongkangc / Kernel.md
Created February 1, 2025 08:52
Kernel example

Writing GPU kernels used to feel like wizardry—arcane knowledge understood by few. But it’s really about unlocking fine-grained control over memory and threads, typically via CUDA (NVIDIA GPUs), Triton (OpenAI’s language for custom kernels), or ROCm (AMD GPUs).

Here’s a quick dive into CUDA, using examples to illustrate key optimization techniques:

  1. Vectorization
    Simultaneously process contiguous data elements to reduce latency.
__global__ void vectorize_add(float *a, float *b, float *c, int n) {  
    int idx = blockIdx.x * blockDim.x + threadIdx.x;  
@yongkangc
yongkangc / scraper.md
Last active January 27, 2025 00:56
Calendar Scraper Scraper

Export Academic Schedule to Calendar (ICS)

This script extracts your class schedule from a university portal (e.g., PeopleSoft/MyPortal) and generates an .ics calendar file for importing into apps like Google Calendar, Outlook, or Apple Calendar.


Prerequisites

  • A browser with developer tools (Chrome, Firefox, Edge).
  • Access to your My Weekly Schedule on the portal.
  • Basic understanding of JavaScript (for troubleshooting).
@yongkangc
yongkangc / Gantz.md
Created October 16, 2024 03:12
V1 Gantz
gantt
    title Gantt Chart for Product, Biz, and Other Dev.
    dateFormat  YYYY-MM-DD
    axisFormat  %b %d

    section Product Dev.
    MVP V1 Bot Server Dev.          :done,    p1, 2024-09-30, 2024-10-20
    MVP V1 Mini App Dev.            :done,    p2, 2024-09-30, 2024-10-20
    Internal MVP V1 Testing         :done,    p3, 2024-10-14, 2024-10-20
@yongkangc
yongkangc / Gantz.md
Created October 16, 2024 03:10
Gantz
gantt
    title Gantt Chart for Product, Biz, and Other Dev.
    dateFormat  YYYY-MM-DD
    axisFormat  %b %d

    section Product Dev.
    MVP V1 Bot Server Dev.          :done,    p1, 2024-09-30, 2024-10-20
    MVP V1 Mini App Dev.            :done,    p2, 2024-09-30, 2024-10-20
    Internal MVP V1 Testing         :done,    p3, 2024-10-14, 2024-10-20
@yongkangc
yongkangc / architecture.md
Last active October 11, 2024 02:51
technical architecture
graph TD
    A[Event Name] -->|Schedule Command| B[Event Schema]
    A --> C[Ideas Schema]
    
    D[Mini App URL] --> E[Ideas Leaderboard]
    D --> F[Call for Ideas]
    
    F --> G[Idea Form]
 G --> H[Ideas Table]
// *************************
// HEAP
// *************************/
// HEAP is an array of bytes (JS ArrayBuffer)
const word_size = 8
// heap_make allocates a heap of given size
// (in bytes) and returns a DataView of that,
@yongkangc
yongkangc / chatgpt.rs
Last active November 9, 2023 08:23
ChatGPT in Rust
use reqwest::header::{HeaderMap, AUTHORIZATION, CONTENT_TYPE};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use std::env;
#[derive(Serialize, Deserialize, Debug)]
struct OAIRequest {
model: String,
messages: Vec<Message>,
}
@yongkangc
yongkangc / Add.sol
Created August 28, 2023 04:24
Add.sol
pragma solidity 0.6.7
contract AddOne {
uint16 private a = 3;
function aPlusOne() external view returns(uint 256) {
return a + 1;
}
@yongkangc
yongkangc / Add.sol
Last active August 28, 2023 04:52
Sample Opcode contract
pragma solidity 0.8.7;
contract AddOne {
uint16 private a = 3;
function aPlusOne() external view returns(uint 256) {
unchecked {
return a + 1;
}
}