Skip to content

Instantly share code, notes, and snippets.

View wwhai's full-sized avatar
🍊
Code world

wwhai wwhai

🍊
Code world
View GitHub Profile
@wwhai
wwhai / avframe_mat.hpp
Created August 6, 2024 09:11 — forked from foowaa/avframe_mat.hpp
ffmpeg avframe and opencv mat
/*!
* \file format_converter.h
*
* \author cltian
* \date 11 2020
*
*
*/
extern "C" {
#include "libavcodec/avcodec.h"
@wwhai
wwhai / docker-registry-mirrors.md
Created November 22, 2023 14:26 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@wwhai
wwhai / ARMonQEMUforDebianUbuntu.md
Created November 14, 2022 14:51 — forked from luk6xff/ARMonQEMUforDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@wwhai
wwhai / netlink_usb.go
Created September 20, 2022 08:10 — forked from XoneStar/netlink_usb.go
go netlink monitor usb
@wwhai
wwhai / git_retag
Created August 3, 2022 08:45 — forked from ultim8k/git_retag
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d v1.0.1
3. push tag deletion to remote
git push origin :refs/tags/v1.0.1
4. tag local branch again
@wwhai
wwhai / cgo-sample.go
Created October 19, 2021 07:31 — forked from 3d0c/cgo-sample.go
cgo samples
package main
/*
#include <string.h>
void write_int(int *len) {
*len = 10;
}
void write_int_array(int *sizes[]) {
@wwhai
wwhai / example.erl
Created October 12, 2021 01:48 — forked from sergium/example.erl
Erlang OTP gen_server template
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% @author Kevin Smith <kevin@opscode.com>
%% @copyright 2011 Opscode, Inc.
-module(example).
-behaviour(gen_server).
-export([start_link/0]).
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@wwhai
wwhai / source.cpp
Created August 29, 2021 14:59 — forked from derofim/source.cpp
SDL2 circle Drawing_and_Filling_Circles
// emcc source.cpp -s USE_SDL=2 -s FULL_ES2=1 --preload-file res/img -o publish\emsripten\index.html -O2 -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="['png']" -std=c++11
// Ported SDL2 : http://content.gpwiki.org/index.php/SDL:Tutorials:Drawing_and_Filling_Circles
#include <chrono>
#include <thread>
#include <future>
#include <SDL.h>
#include <stdio.h>
#include <string>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
@wwhai
wwhai / init.vim
Created July 18, 2021 05:37 — forked from benawad/init.vim
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'