Skip to content

Instantly share code, notes, and snippets.

View fanweixiao's full-sized avatar
🦖
hacking on @yomorun

C.C. fanweixiao

🦖
hacking on @yomorun
View GitHub Profile
@fanweixiao
fanweixiao / main.go
Created March 2, 2024 06:30
Implement OpenAI Function Calling by YoMo: Get realtime currency exchange rate
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
@fanweixiao
fanweixiao / ggml-base-q5_1.bin
Created February 7, 2024 09:08
AWS Graviton3 32vCPUs
$ ./main -m models/ggml-base-q5_1.bin -f ~/zh.wav
whisper_init_from_file_with_params_no_state: loading model from 'models/ggml-base-q5_1.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab = 51865
whisper_model_load: n_audio_ctx = 1500
whisper_model_load: n_audio_state = 512
whisper_model_load: n_audio_head = 8
whisper_model_load: n_audio_layer = 6
whisper_model_load: n_text_ctx = 448
whisper_model_load: n_text_state = 512
@fanweixiao
fanweixiao / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created February 16, 2023 12:57 — forked from shqld/cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
@fanweixiao
fanweixiao / udp-loader.go
Created April 5, 2022 03:03 — forked from jtblin/udp-loader.go
UDP server performance optimisation
package main
import (
"crypto/rand"
"flag"
"log"
mrand "math/rand"
"net"
"os"
"os/signal"
@fanweixiao
fanweixiao / konami-cheatcode-rx.js
Created November 22, 2021 06:58 — forked from MartinSeeler/konami-cheatcode-rx.js
Konami Cheat-Code with RxJs
var cheatCode = [38,38,40,40,37,39,37,39,66,65]; // Konami Cheat Code
Rx.Observable
.fromEvent(document, 'keydown')
.map(function(x) { return x.keyCode; })
.windowWithCount(cheatCode.length, 1)
.flatMap(function(xs) { return xs.toArray(); })
.do(function (x) { console.log(x); })
.filter(function(xs) { return _.isEqual(cheatCode, xs); })
.subscribe(function(x) { console.log('CHEATER!!11elf'); });
@fanweixiao
fanweixiao / YoMo_CLA.md
Last active June 5, 2021 06:08
YoMo Individual Contributor License Agreement

Xile Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Xile or its affiliates (“Xile”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Xile in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact oss@yomo.run.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to Xile a non-exclusive, perpetual, irrevocable, worldwide,

@fanweixiao
fanweixiao / introrx.md
Created July 6, 2020 09:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@fanweixiao
fanweixiao / ascii-art-of-yomo
Last active March 8, 2023 06:50
yomo ascii art
██╗░░░██╗░█████╗░███╗░░░███╗░█████╗░
╚██╗░██╔╝██╔══██╗████╗░████║██╔══██╗
░╚████╔╝░██║░░██║██╔████╔██║██║░░██║
░░╚██╔╝░░██║░░██║██║╚██╔╝██║██║░░██║
░░░██║░░░╚█████╔╝██║░╚═╝░██║╚█████╔╝
░░░╚═╝░░░░╚════╝░╚═╝░░░░░╚═╝░╚════╝░
█▄█ █▀█ █▀▄▀█ █▀█
@fanweixiao
fanweixiao / gist:03979a7b62c886b9cc6b0630be4bc34e
Created June 9, 2017 08:39 — forked from Mika-/gist:185c8d777aab3ebba548
Resize and convert image to web optimized jpg with imagemagick and mozjpeg
convert source.png -resize 1920x1080 -background white -flatten TGA:- | cjpeg -quality 90 -targa -outfile compressed.jpg
@fanweixiao
fanweixiao / test-child-process-signals.js
Created January 9, 2017 08:10 — forked from coltrane/test-child-process-signals.js
Tests the response of node.js child processes to various posix signals.
var child_process = require('child_process'),
assert = require('assert')
var isChild = !!(process.send),
isMaster = ((!isChild) && (process.argv.length > 2)),
isTopLevel = (!isMaster && !isChild)
if( isTopLevel ) {