The goal of this project is to construct a functional interactive matrix processing system with confidence, using test-driven methodology.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import sys, os | |
| import json | |
| import time | |
| from tqdm import tqdm | |
| import requests | |
| import lxml.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unitsize(2mm); | |
| srand(101); | |
| real Width = 100.0; | |
| real Height = 133.04; | |
| real ColorOffset = 0.3; | |
| path BBox = (0,0)--(Width, 0)--(Width, Height)--(0, Height)--cycle; | |
| path BAR = scale(0.1*Width, 0.7*Width) * shift(-0.5, -0.5) * unitsquare; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": 1, | |
| "notes": "My awesome keymap", | |
| "documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", | |
| "keyboard": "xd96", | |
| "keymap": "mw96", | |
| "layout": "LAYOUT_96_ansi", | |
| "layers": [ | |
| [ | |
| "KC_ESC", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern crate sdl2; | |
| use std::path::Path; | |
| use std::time::Duration; | |
| use sdl2::render::Canvas; | |
| use sdl2::video::Window; | |
| use sdl2::event::Event; | |
| use sdl2::keyboard::Keycode; | |
| use sdl2::rect::{Point, Rect}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def props_to_sort_lambda(*props): | |
| """Return a function that sorts according to property list `props`. | |
| The sort is supposed to apply on a list of dictionaries with the same set of | |
| keys. Argument `props` is a list of keys for the dicts. | |
| Example: | |
| xs = [{"aaa": 1, "bbb": 2, ...}, {"aaa": 2, "bbb": 3, ...}, ...] | |
| sorted_xs = props_to_sort_lambda("-aaa", "bbb")(xs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Compile: | |
| // | |
| // - Linux: g++ -O2 -pthread factorial.cc | |
| // - Mac: clang++ -O2 -std=c++11 factorial.cc | |
| #include <vector> | |
| #include <string> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <sstream> |
FreeNAS (FYI, soon to be renamed to TrueNAS CORE). FreeBSD + OpenZFS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IsEnabled := false | |
| FlaskIdx := 2 | |
| #IfWinActive Path of Exile | |
| `:: | |
| IsEnabled := !IsEnabled | |
| if (IsEnabled) | |
| { | |
| SetTimer, TimerFlask, 1500 |
我有四台常用的电脑:工作用 Mac,工作用大便,私用 Mac,私用 Gentoo,这四台电脑的主要配置都差不多,只在少数地方不同。
以 Git 为例,这四台电脑上都有相同的 ~/.gitignore,相同的 ~/.gitconfig。不同之处是有一台电脑上设置了默认开启 gpg-sign,另外几台电脑上设置好了 GPG,但是 Git 不默认添加签名。
另一个例子是 Xmonad/Xorg,显然在两台 Mac 上是没有 Xmonad 的,这时原则上上不需要安装配置(但是配置了也无所谓)。在大便上,进入图形界面的时候会调用 ~/.xinitrc,里面有我的输入法设置和壁纸设置,而在 Gentoo 上,这些设置在 ~/.xprofile 里。