View conv.cc
This file contains 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
#include <assert.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <windows.h> // 各种位图数据结构 | |
class Converter | |
{ | |
public: | |
Converter() : pixels_(NULL), width_(0), height_(0) {} |
View GetMapValue.cc
This file contains 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
#include <algorithm> | |
#include <iostream> | |
#include <map> | |
#include <unordered_map> | |
// MapTraits<MapType, KeyType1, KeyType2, KeyType3...> | |
// --------------------------------------------------- | |
// 连续使用 KeyType1, KeyType2, KeyType3... 对 MapType 进行取 Value 操作后的信息 | |
template <typename MapType, typename KeyType, typename... KeyTypes> |
View map-capslock-to-ctrl.reg
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 |
View math.patch
This file contains 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
--- markdown.php 2013-11-30 00:09:34.000000000 +0800 | |
+++ markdown.php 2020-03-12 14:54:15.000000000 +0800 | |
@@ -41,6 +41,9 @@ | |
# setting this to true will put attributes on the `pre` tag instead. | |
@define( 'MARKDOWN_CODE_ATTR_ON_PRE', false ); | |
+# Optional class attribute for math. | |
+@define( 'MARKDOWN_MATH_CLASS', "" ); | |
+ | |
View dnspod.py
This file contains 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
import urllib.parse | |
import requests | |
class DnspodException(Exception): | |
pass | |
class DnspodErrorResponse(DnspodException): |
View base64.c
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
static char const encode_map[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
"abcdefghijklmnopqrstuvwxyz" | |
"01234567890+/"; | |
char *base64_encode(char const *data, size_t size); | |
char *base64_decode(char const *code, size_t *size); |
View roman.cc
This file contains 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
#include <algorithm> | |
#include <cassert> | |
#include <string> | |
std::string toRoman(int number) | |
{ | |
static struct { | |
int value; | |
char const *symbols; | |
} const mapping[] = { |