Instantly share code, notes, and snippets.

View windows-10-git.md

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
View ryzen-segfault-test.sh
#!/bin/sh
sudo apt install git
git clone https://github.com/suaefar/ryzen-test
cd ryzen-test
./kill_ryzen.sh
View disable-cortana.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"AllowCortana"=dword:00000000
View unit-testing-mindset.md

On UNIT TESTING I'd recommend/remind (some of them may have exceptions when testing non-TDD legacy):

  • given/when/then or arrange/act/assert structuring;
  • use before each/ after each for setting up common resources;
  • one assert per test method (or at least minimal, keeping it sane);
  • avoid test interdependence;
  • keep tests plan, free of if/ while/ for/ case and shared methods/ functions. Create methods for different conditions;
  • duplicated code is better than shared functions/methods;
  • do unit test behavior (input and output). Don't go spying on internal variables and dependencies as this may change and break tests, even when the inputs and outcomes are in compliance with the specification. (Ex: if you spy a call on a dependency of toBase64... and the dependency is not used anymore, test will break even if the input and output are right);
  • exceptions are exceptions, we can't do much on legacy built without TDD in mind.
View choco-install.md
(choco install -y 7zip.install
adobereader
agentransack
autohotkey.portable
brave
curl
dejavufonts
docker
FiraCode
View retrive-windows-10-key.vbs
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
View Arch Linux mkinitcpio: Possibly missing firmware for module.md

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
View aoc-viewsonic.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 396.24 (builduser@felixonmars2) Wed May 9 20:37:28 CST 2018
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
View dedent-template.js
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;
View hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',