Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

JiangYD jan4984

🎯
Focusing
  • rcrai.com
  • ShangHai
View GitHub Profile
View golangci-lint-present.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>golangci-lint Lint Visualization</title>
<link href="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.css" rel="stylesheet">
<script src="https://unpkg.com/vue@2.4.2/dist/vue.js"></script>
<script src="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.js"></script>
</head>
<section>
View golangci-lint-present.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>golangci-lint Lint Visualization</title>
<link href="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.css" rel="stylesheet">
<script src="https://unpkg.com/vue@2.4.2/dist/vue.js"></script>
<script src="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.js"></script>
</head>
<section>
@jan4984
jan4984 / main.go
Created Feb 17, 2020
simple txt copy via web
View main.go
package main
import (
"fmt"
"html/template"
"io/ioutil"
"net/http"
)
var txt = ""
@jan4984
jan4984 / ws-c.cpp
Created Aug 29, 2019
websock in simple c++
View ws-c.cpp
#include <unistd.h>
#include <assert.h>
#include <iostream>
#include <string>
#include <wslay/wslay.h>
#include <sys/socket.h>
#include <netdb.h>
#include <cstring>
#include <poll.h>
@jan4984
jan4984 / pulseaudio-ffmpeg.md
Last active Jan 28, 2021
audio over tcp with pulseaudio and ffmpeg
View pulseaudio-ffmpeg.md

linux(WSL)

  • 永久启用pulseaudio

/etc/pulse/client.conf

autospawn = yes
@jan4984
jan4984 / reverse-proxy.go
Created Aug 21, 2018
simple proxy for LAN https
View reverse-proxy.go
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
rpURL, err := url.Parse("http://10.0.0.125:8080")
View binary to java bytes
File.stream!("/home/jan/prjs/opus-codec-service/src/git.ogo.run/opuscodec/testprebuilts/far.opus.dong", [], 1) |> Enum.map(fn bl -> :binary.bin_to_list(bl) |> hd end) |> Enum.each(fn b -> if b >= 128 do IO.write "#{b-256}," else IO.write "#{b}," end end)
View binary to java bytes
File.stream!("/home/jan/prjs/opus-codec-service/src/git.ogo.run/opuscodec/testprebuilts/far.opus.dong", [], 1) |> Enum.map(fn bl -> :binary.bin_to_list(bl) |> hd end) |> Enum.each(fn b -> if b >= 128 do IO.write "#{b-256}," else IO.write "#{b}," end end)
View jni_helper.cpp
#include <jni.h>
#include <string>
#define _MACRO_CONCAT(a,b) a ## b
#define _MACRO_2_STR(a) #a
#define _TOSTR(a) _MACRO_2_STR(a)
#define JMETHOD_VAR(n) _MACRO_CONCAT(jmethodId, n)
#define JMETHOD_DECLARE(cn,n,s) static jmethodID JMETHOD_VAR(n);
#define JMETHOD_GET(cn, n,s) JMETHOD_VAR(n) = jEnv->GetMethodID(_MACRO_CONCAT(jclass, cn), #n, s);
@jan4984
jan4984 / data2bmp.go
Created Jan 26, 2018
encode/decode binary data in bitmap
View data2bmp.go
package main
import (
"image"
"os"
"io/ioutil"
"math"
"golang.org/x/image/bmp"
"log"
"bytes"