Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Busy...

Richard Chen iochen

💭
Busy...
View GitHub Profile
View gjldcdngmdknpinoemndlidpcabkggco_ct.js
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=64)}({12:function(e,t,n){var r;
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes S
View multibuild.go.sh
#!/bin/sh
p=`pwd`
binname=`basename $p`
mkdir $binname/{linux-386,linux-arm,linux-arm5,linux,freeBSD,win64,win32,mac,zip} -p
env GOARCH=386 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-386/$binname &
env GOARCH=arm GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm/$binname &
env GOARCH=arm GOARM=5 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm5/$binname &
View random_cut.go
package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
func main() {
@iochen
iochen / first_attempt.rs
Created Mar 27, 2021
first attempt on Rust
View first_attempt.rs
enum IPAddr {
IPv4(u8, u8, u8, u8),
IPv6(String),
}
fn main() {
let ip1 = IPAddr::IPv4(127, 0, 0, 1);
let ip2 = IPAddr::IPv6(String::from("::1"));
print_ip(&ip1);
print_ip(&ip2);
@iochen
iochen / mp3_player.go
Created Mar 27, 2021
playing mp3 with golang
View mp3_player.go
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/hajimehoshi/oto"
"github.com/tosone/minimp3"
@iochen
iochen / drive.html
Created Feb 3, 2021
thanks for onelist
View drive.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Drive</title>
<style>
@font-face{
font-family: 'icomoon';
src : url("data:application/x-font-woff;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBwQAAAC8AAAAYGNtYXDTrtL+AAABHAAAAGxnYXNwAAAAEAAAAYgAAAAIZ2x5Zizg66wAAAGQAAACOGhlYWQXasWNAAADyAAAADZoaGVhB8IDyQAABAAAAAAkaG10eBYAAJMAAAQkAAAAIGxvY2ECEgFAAAAERAAAABJtYXhwAA8AZgAABFgAAAAgbmFtZZlKCfsAAAR4AAABhnBvc3QAAwAAAAAGAAAAACAAAwOaAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADqQAPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAUAAAABAAEAADAAAAAQAg6QDpJukw6kD//f//AAAAAAAg6QDpJukw6kD//f//AAH/4xcEFt8W1hXHAAMAAQAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACAAAAAAQAA6EABQAOAAAJAjUJAQcRIREhESERAQQA/gD+AAIAAgCA/wD/AP8AAYABcgGN/nOiAY3+c5T+gAEA/wABgAEgAAAGAED/wAPAA8AAGQAhADkARwBVAGMAAAEuAScuAScuASMhIgYVERQWMyEyNjURNCYnJx4BFyM1HgETFAY
View cq_render.go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"github.com/unidoc/unioffice/common"
"github.com/unidoc/unioffice/document"
@iochen
iochen / transform.go
Created Oct 16, 2020
golang png alpha channel issue
View transform.go
package hidden_test
import (
"image"
"image/color"
_ "image/jpeg"
"image/png"
"net/http"
"os"
"testing"
View GPG.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mJMEXjY9yRMFK4EEACMEIwQBufF78MZUX26sE7HGp4ZR2hq/pVKunJpjP1mEzIza
bzYB8bo7qc0cocSAiRgZn4BjkuypAA/zqhM7pALXStAmBksAGN0TcmsZCzqUgcM5
LMKqJT/6AiGSoTp0weMAVSFhXNPRtF6HaryRSFRQxQY98RNKC9/RaSUbAt/kfZ50
sU0iL4u0IlJpY2hhcmQgQ2hlbiA8aW9jaGVuY29tQGdtYWlsLmNvbT6I2gQTEwoA
PhYhBNjv9sclDPc3lxCmgL2Bs/ua7DlRBQJeNj3JAhsDBQkLRzUABQsJCAcCBhUK
CQgLAgQWAgMBAh4BAheAAAoJEL2Bs/ua7DlRv18CCQEXYvnVdK2IkHqhvkcINYWZ
60TxBQiGq1TK9WNlqd0s9Xap77YXuJFpQ001A9XOiyUKibAOtXKmvSTgtuwn6Tn3
PgIJAQ26tj4MxTsgU6zLmNCl8WaA2s/aNev9fcrzd0EpfF8fmNu13+I1vJr7ABAR
View v2ex_655102.go
package main
import "fmt"
func Collatz(i uint64, round int) int {
if i < 2 {
return round
}
if i%2 == 0 {