Skip to content

Instantly share code, notes, and snippets.

View limingjie's full-sized avatar
❄️

Mingjie Li limingjie

❄️
View GitHub Profile
@limingjie
limingjie / ncurses.5.9.md
Created April 24, 2015 14:53
Build ncurses 5.9 with MinGW

#Build ncurses 5.9 with MinGW

  • Download
http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
  • Modify Code
ncurses-5.9\ncurses\lib_keyname.c
line 174/282/284/316, remove newline before \0.
@limingjie
limingjie / _readme.md
Last active August 29, 2015 14:19 — forked from shime/_readme.md

Having trouble installing the latest stable version of tmux?

I know, official package for your OS/distro is outdated and you just want the newest version of tmux.

Well, this script should save you some time with that.

Prerequisities

  • gcc
@limingjie
limingjie / colors.sh
Last active August 29, 2015 14:20
colors.sh
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
@limingjie
limingjie / introrx.md
Last active August 29, 2015 14:20 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@limingjie
limingjie / mupdf.archlinux.md
Created June 2, 2015 15:33
Build MuPDF on Archlinux
$ uname -a
Linux ArchLinux_MJ 4.0.4-2-ARCH #1 SMP PREEMPT Fri May 22 03:05:23 UTC 2015 x86_64 GNU/Linux
$ pwd
/home/mingjie/Programming/mupdf-1.7a-source
$ sudo make build=release
...
$ sudo make build=release install                                                                                                                        2 ↵
    CC build/release/pdf/pdf-cmap-table.o
    RM build/release/libmupdf.a
@limingjie
limingjie / xfce4.arch.vmware.md
Last active January 17, 2016 21:04
Install Gnome/Xfce4 on Archlinux (VMware)

###Install X Server

$ sudo pacman -S xorg-server

###Install VMware Drivers

$ sudo pacman -S open-vm-tools xf86-video-vmware xf86-input-vmmouse
@limingjie
limingjie / console.txt
Created April 22, 2016 05:24
regex perf test
$ g++ -Wall -O2 -std=c++11 -o regex_test_perf regex_test_perf.cpp stopwatch.hpp
$ ./regex_test_perf.exe
[regex e1 ] resume...
[regex e1 ] paused. 0m00.306s / 306.031 x 1/1000s
[regex e2 ] resume...
[regex e2 ] paused. 0m00.144s / 144.014 x 1/1000s
[string find ] resume...
[string find ] paused. 0m00.014s / 14.001 x 1/1000s
[regex e1 ] resume...
@limingjie
limingjie / TestRandomGenerator.cpp
Last active August 23, 2016 10:12
Test Random Generator
#include <iostream>
#include <random>
#include <map>
#include <chrono>
int main()
{
// Random Device
std::random_device rd;
@limingjie
limingjie / libevent2.0.22.md
Last active March 16, 2018 06:19
Build libevent 2.0.22 with MinGW

Build libevent 2.0.22 with MinGW

  • Download
http://jaist.dl.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
  • Build
$ ./configure --prefix=/mingw
$ ./configure && make
$ make install
@limingjie
limingjie / keymap.c
Last active August 31, 2018 04:16
Custom Keyboard XD60 - Use RGB Underglow to Indicate Caps Lock and Layers
#include QMK_KEYBOARD_H
// Helpful Defines
#define _______ KC_TRNS
#define FN_CAPS LT(1, KC_CAPS)
#define LSFT_GRV LSFT_T(KC_GRV)
#define RSFT_SLSH RSFT_T(KC_SLSH)
#define RSFT_UP RSFT_T(KC_UP)
// Mac Keyboard Shorts