View gist:800786d32b2d46362035
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
### Keybase proof | |
I hereby claim: | |
* I am charlie-x on github. | |
* I am charliex (https://keybase.io/charliex) on keybase. | |
* I have a public key whose fingerprint is FE99 5AE5 E4B0 E180 D3D2 7D6D F82C 093B EDD7 5A23 | |
To claim this, I am signing this object: |
View layout.kbd.json
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
[ | |
{ | |
"backcolor": "#000000", | |
"switchMount": "cherry", | |
"switchBrand": "cherry", | |
"switchType": "MX3A-11Nx", | |
"pcb": true | |
}, | |
[ | |
{ |
View gist:e660af069777b0dfbcaf980e9b7f5501
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
add rc.exe to path, windows sdk etc, default C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64 | |
add nasm.exe https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/win64/ default C:\Program Files\NASM | |
vcvars64.bat from 2017 folder default C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build | |
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64 | |
# no-shared for static libs | |
# inside openssl extracted source folder | |
perl configure VC-WIN64A --openssldir=C:\OpenSSL-Win64 no-asm no-shared | |
View gist:c4e8b4f0eac3e4b590cd3c1472a6ad50
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
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
rem choco install visualstudio2013professional %1 -y | |
choco install visualstudio2015professional %1 -y | |
choco install teamviewer9 %1 -y | |
chocolatey install paint.net %1 -y | |
chocolatey install tortoisegit %1 -y | |
chocolatey install tortoisesvn %1 -y | |
chocolatey install autodesk-fusion360 %1 -y | |
chocolatey install f.lux %1 -y | |
chocolatey install sysinternals %1 -y |
View gist:aba3728313d3da66565e027e048dce1e
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
{NOTE_D5, 600, 50}, | |
{NOTE_E5, 600, 50}, | |
{NOTE_G5, 150, 50}, | |
{NOTE_REST, 100, 50}, | |
{NOTE_G5, 150, 50}, | |
{NOTE_REST, 100, 50}, | |
{NOTE_G5, 150, 50}, |
View gist:b9c0e316154bd03d453ba89d1ae3f4a2
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
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer |
View gist:f9d8b0f25cc1c7612cc58ab29901e9ec
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
$Path = $env:TEMP; $Installer = "426.23-tesla-desktop-win10-64bit-international.exe"; Invoke-WebRequest "http://us.download.nvidia.com/tesla/426.23/426.23-tesla-desktop-win10-64bit-international.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "" -Verb RunAs -Wait; Remove-Item $Path\$Installer |
View gist:33cdd141434a5526d49742418c1a1940
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 <array> | |
#include <thread> | |
#include <atomic> | |
#include <emmintrin.h> | |
struct spin_mutex { | |
void lock() noexcept { | |
// approx. 5x5 ns (= 25 ns), 10x40 ns (= 400 ns), and 3000x350 ns | |
// (~ 1 ms), respectively, when measured on a 2.9 GHz Intel i9 | |
constexpr std::array iterations = {5, 10, 3000}; |
View ConvertUnicodeToUTF8
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
CStringA ConvertUnicodeToUTF8(const CStringW& uni) | |
{ | |
if (uni.IsEmpty()) return ""; // nothing to do | |
CStringA utf8; | |
int cc = 0; | |
// get length (cc) of the new multibyte string excluding the \0 terminator first | |
if ((cc = WideCharToMultiByte(CP_UTF8, 0, uni, -1, NULL, 0, 0, 0) - 1) > 0) | |
{ |
View gist:d3b265ccb427139ee39619ae5736ebb9
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
int vasprintf(char** strp, const char* format, va_list ap) | |
{ | |
int len = _vscprintf(format, ap); | |
if (len == -1) | |
return -1; | |
char* str = (char*)malloc((size_t)len + 1); | |
if (!str) | |
return -1; | |
int retval = vsnprintf(str, len + 1, format, ap); |
OlderNewer