- Download source files
- Run
npm installto install all dependencies. - Run
npm run buildto bundleapp.jsintobundle.js
- Open
index.htmlin a browser.
| const octokit = require('@octokit/rest')(); | |
| octokit.authenticate({ | |
| type: 'token', | |
| token: 'xxxxxx your token xxxxxxxx' | |
| }); | |
| async function paginate (method) { | |
| let response = await method({ | |
| owner: 'Junch', |
| --- | |
| BasedOnStyle: LLVM | |
| IndentWidth: 4 | |
| --- | |
| Language: Cpp | |
| BreakBeforeBraces: Allman | |
| ColumnLimit: 0 | |
| NamespaceIndentation: All |
| 最近使用pip3总会timeout,试了试下面的镜像站,速度却非常快 | |
| https://mirror.tuna.tsinghua.edu.cn/help/pypi/ | |
| pip install -i https://pypi.tuna.tsinghua.edu.cn/simple | |
| #include <windows.h> | |
| #include <iostream> | |
| #pragma comment(lib, "advapi32.lib") | |
| int main() | |
| { | |
| char value[255]; | |
| DWORD BufferSize = sizeof(value); | |
| RegGetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot", RRF_RT_ANY, NULL, (PVOID)&value, &BufferSize); |
| // Convert a wide Unicode string to an UTF8 string | |
| std::string utf8_encode(const std::wstring &wstr) | |
| { | |
| int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); | |
| std::string strTo(size_needed, 0); | |
| WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); | |
| return strTo; | |
| } | |
| // Convert an UTF8 string to a wide Unicode String |
| #!/bin/bash | |
| # Refer to | |
| # 1. http://blog.51cto.com/liveforlinux/689382 | |
| # 2. https://sarcasm.github.io/notes/dev/compilation-database.html | |
| # 3. https://unix.stackexchange.com/questions/38172/switching-to-zsh-are-all-bash-scripts-compatible-with-zsh/38173 | |
| # 在scons文件中,添加 env.Append(CCFLAGS=['-MJ', '${TARGET}.json']) | |
| find ./out/macosx-10.13-x86_64-rel/obj-static/src/ -name "*.o.json" | xargs sed -e '1s/^/[\'$'\n/' -e '$s/,$/\'$'\n]/' > compile_commands.json |
find . -name *.cpp | xargs clang-tidy -header-filter='Spark*.*' -checks='-*,modernize-*,readability-*' -fix| grep -rl --include=\*.java "boolean moreResults" . | xargs sed -i '' 's/boolean moreResults/boolean isFinishedSearching, boolean isMoreResults/g' | |
| ag -l moreResults -G ".m" | xargs sed -i '' 's/moreResults:(BOOL)moreResults/isFinishedSearching:(BOOL)isFinishedSearching isMoreResults:(BOOL)isMoreResults/g' | |
| noglob find . -type f -name SearchBoxPanel.* | xargs sed -i '' 's/bool moreResults/bool isFinishedSearching, bool isMoreResults/g' | |
| find . -name AndroidABEquivalenceSearchQuery.cpp | xargs subl |
| // https://bytefreaks.net/programming-2/c/cc-full-example-of-reading-a-whole-binary-file-to-buffer | |
| struct binary_data_t | |
| { | |
| long size; | |
| void *data; | |
| binary_data_t() : size(0), data(nullptr) {} | |
| ~binary_data_t() { delete[] data; } | |
| }; |