Skip to content

Instantly share code, notes, and snippets.

View chendotjs's full-sized avatar

Chen Yaqi chendotjs

  • Shanghai
  • 12:09 (UTC +08:00)
View GitHub Profile
@chendotjs
chendotjs / usb_example.cc
Created November 27, 2018 14:09
usb_example for pixelx
// https://www.beyondlogic.org/usbnutshell/usb5.shtml
#include <bits/stdc++.h>
#include <libusb-1.0/libusb.h>
using namespace std;
#define PIXELX 1
#define ABORT_ON(ret, msg) \
do { \
if (ret < 0) { \
@chendotjs
chendotjs / godoc.vim
Last active August 24, 2019 15:25
goman
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
" ~/.vim/syntax/godoc.vim
if exists("b:current_syntax")
finish
endif
noremap <buffer> q :q!<CR>
@chendotjs
chendotjs / eventpoll.c
Last active March 2, 2018 15:17
a commented epoll implemention in kernel
/*
 *  fs/eventpoll.c (Efficient event retrieval implementation)
 *  Copyright (C) 2001,...,2009  Davide Libenzi
 *
 *  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.
 *
 *  Davide Libenzi <[email protected]>
@chendotjs
chendotjs / complie command
Created June 27, 2017 09:17
memory mock test
g++ -Wl,--wrap=malloc -Wl,--wrap=free test.cpp