Skip to content

Instantly share code, notes, and snippets.

@MarcoQin
MarcoQin / waitForKeyElements.js
Created July 6, 2018 03:42 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@MarcoQin
MarcoQin / fun.cpp
Created December 8, 2016 08:52 — forked from kizzx2/fun.cpp
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
@MarcoQin
MarcoQin / 词性标记.md
Created July 5, 2016 02:13 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@MarcoQin
MarcoQin / mpv_sdl_sample.c
Created May 27, 2016 08:04
libmpv with sdl2 opengl sample. and some SDL_ttf display sample code.
// Build with: gcc -o main main.c `pkg-config --libs --cflags mpv sdl2`
// gcc -g -o main mpv_sample.c `pkg-config --libs --cflags mpv sdl2` -lass -framework OpenGL
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
@MarcoQin
MarcoQin / ffmpeg_danmaku.c
Created May 11, 2016 02:55
ffmpeg with libass and sdl2_ttf library, to display video and ass danmaku sample.
// tutorial05.c
// A pedagogical video player that really works!
//
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard,
// and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de)
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1
// With updates from https://github.com/chelyaev/ffmpeg-tutorial
// Updates tested on:
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15
// on GCC 4.7.2 in Debian February 2015
@MarcoQin
MarcoQin / ffmpeg_tutorial05.c
Last active October 27, 2023 08:45
ffmpeg tutorial 05 with SDL2 and audio resampling fix
// tutorial05.c
// A pedagogical video player that really works!
//
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard,
// and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de)
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1
// With updates from https://github.com/chelyaev/ffmpeg-tutorial
// Updates tested on:
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15
// on GCC 4.7.2 in Debian February 2015
@MarcoQin
MarcoQin / ffmpeg_tutorial04.c
Last active June 2, 2020 13:21
ffmpeg_tutorial04 SDL2.0 and resampling version
// tutorial04.c
// A pedagogical video player that will stream through every video frame as fast as it can,
// and play audio (out of sync).
//
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard,
// and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de)
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1
// With updates from https://github.com/chelyaev/ffmpeg-tutorial
// Updates tested on:
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15
@MarcoQin
MarcoQin / sheet_spider.py
Created February 17, 2016 09:17
Animenzzz sheets spider
#!/usr/bin/env python
# encoding: utf-8
import requests
def extract(begin, end, html):
if not html:
return ''
start = html.find(begin)