Skip to content

Instantly share code, notes, and snippets.

View kevmo314's full-sized avatar
🐮
Mugit!

Kevin Wang kevmo314

🐮
Mugit!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kevmo314 on github.
  • I am kevmo314 (https://keybase.io/kevmo314) on keybase.
  • I have a public key whose fingerprint is 17CD E3E5 75C0 1128 BC66 0A2D F7A7 E284 28CE B651

To claim this, I am signing this object:

@kevmo314
kevmo314 / twitter.user.js
Created November 12, 2020 01:31
Twitter Canned Replies
// ==UserScript==
// @name Twitter Canned Replies
// @namespace https://www.twitter.com/
// @version 1.0
// @description Adds ability to create/send canned replies to DMs
// @author Kevin Wang <[email protected]>
// @match https://www.tampermonkey.net/index.php?version=4.9.6095&ext=fire&updated=true
// @include https://twitter.com/messages/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant GM.setValue
@kevmo314
kevmo314 / Dockerfile
Last active April 28, 2021 03:40
nginx + nginx-rtmp + ffmpeg + libsrt
FROM ubuntu:20.04
RUN apt-get -qq update && apt-get -qq upgrade
ENV NGINX_VERSION nginx-1.19.3
ENV FFMPEG_VERSION snapshot
ENV NGINX_RTMP_MODULE_VERSION 1.2.1
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/New_York
@kevmo314
kevmo314 / interceptor.go
Last active November 18, 2021 04:08
Interceptor API proposal
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/pion/interceptor"
"github.com/pion/interceptor/pkg/nack"
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#include <dt-bindings/gpio/gpio.h>
/ {
host1x {
vi {
num-channels = <1>;
ports {
#address-cells = <1>;
/*
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
package ecn
import (
"net"
"reflect"
"syscall"
)
// EnableExplicitCongestionNotification enables ECN on the given connection.
func EnableExplicitCongestionNotification(conn *net.UDPConn) {
@kevmo314
kevmo314 / why.md
Last active July 30, 2024 18:56
Please stop reinventing JSX

Please stop reinventing JSX

It really grinds my gears when I see this pattern, in particular navigation bars and sidebars seem to attract it:

const navItems = [
  {
    title: 'home',
    link: '/home',
 },
@kevmo314
kevmo314 / README.md
Last active February 24, 2025 21:11
Llama inference in 150 lines.

It turns out if you're just doing inference, Llama can be written very concisely. This implementation includes paged attention. Speculative decoding can also be added for another speed boost however it's quite verbose and was left out to keep the implementation cleaner.

Download the Llama files and place them in a directory ./Llama3.2-3B (or whatever flavor of Llama you want).

Your directory structure should look like:

./Llama3.2-3B/consolidated.00.pth
// An example of how to use the FFmpeg HLS muxer without ever touching the disk.
//
// To compile:
// cc main.c -lavcodec -lavformat -lavutil
//
// To run:
// ffmpeg -hide_banner -loglevel error -f lavfi -i testsrc -pix_fmt yuv420p -f mpegts - | ./a.out
#include <unistd.h>