Archive

Archive for the ‘Uncategorized’ Category

TabNine stopped working with Sublime Text

December 21, 2019 Leave a comment

Problem
TabNine is an awesome plugin that every developer should use. Unfortunately, it stopped working for me a few days ago.

Solution
I found the solution here: https://github.com/zxqfl/TabNine/issues/207 . In short: go to the folder ~/.config/sublime-text-3/Packages/TabNine/binaries/2.1.22, create a folder called x86_64-unknown-linux-musl, and copy the binary from x86_64-unknown-linux-gnu to this newly created folder x86_64-unknown-linux-musl. Finally, restart Sublime Text.

Categories: Uncategorized Tags: , ,

How to loop a YouTube video?

December 17, 2018 Leave a comment

Problem
You have a favorite song and you want to listen to it in a loop.

Solution
Right click on the video and select “Loop”.

[Nim] cross-compile under Linux to Windows

October 23, 2018 1 comment

Problem
You are under Linux, and you can produce an executable binary with the Nim compiler. However, you would like to produce a Windows EXE too. We want to stay under Linux and we want to produce the EXE on Linux. How to do that?

Solution
On Manjaro, I had to install this package:

$ yaourt -S mingw-w64-gcc-bin

It’s a cross-compiler that we’ll use for producing the EXE.

Let’s take a simple Nim source (hello.nim):

echo "hello windows"

Now cross-compile it:

$ nim --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc -d:release c hello.nim

And you get hello.exe .

$ file hello.exe
hello.exe: PE32+ executable (console) x86-64, for MS Windows

If you copy it on a Windows system, you can run it there without any problem. Or, you can also run it under Linux with wine :)

$ wine hello.exe
hello windows

Credits
I found this idea in the following blog post: Writing a 2D Platform Game in Nim with SDL2.

Update (20181028)
I found info about it in the official docs too: https://nim-lang.github.io/Nim/nimc.html#cross-compilation-for-windows.

moved from KeePassX to KeePassXC

October 13, 2018 Leave a comment

KeePassX served me very well in the last few years. It’s a password manager that keeps your usernames / passwords in an encrypted file and you only need to memorize just one master password.

KeePassXC is the community edition of KeePassX. From its FAQ: “KeePassX is an amazing password manager, but hasn’t seen much active development for quite a while. Many good pull requests were never merged and the original project is missing some features which users can expect from a modern password manager. Hence, we decided to fork KeePassX to continue its development and provide you with everything you love about KeePassX plus many new features and bugfixes.

I tried it and it could open my .kdbx database file without any problem. It has some nice changes compared to KeePassX so I think I’ll use this newer and fresher version. Just like KeePassX, it runs under Linux and Windows too.

Xbox 360 controller not detected

March 16, 2018 Leave a comment

Problem
I have a wired Xbox 360 controller that stopped working. Windows 7 doesn’t recognise it and it appears as an “unknown device”.

Solution
I tried everything: uninstall and reinstall the driver; reinstall the USB drivers that I got on a DVD for the motherboard; plug it in another USB slot. Nothing. After 1.5 hours, I found the solution: the cord has an inline release and it was not entirely connected… Damn. But the good news is that it works again :)

Lesson learned: if you have a problem with the controller, first check the inline release.

inline_release

Software Carpentry

January 3, 2018 Leave a comment

Software Carpentry is a community of volunteer instructors who teach short workshops and develop lessons which empower researchers of all disciplines to learn about and improve the ways in which they create software and collaborate.” (source)

I found them today: https://github.com/swcarpentry/swcarpentry . Looks good!

[VS Code] When commenting a line, move the cursor to the next line

January 2, 2018 Leave a comment

Problem
In IntelliJ IDEA, when you comment a line, the cursor is moved automatically to the next line. This way it’s very easy to comment several lines. In VS Code the cursor stays on the same line. How to copy the behavior of IntelliJ?

Solution
I asked this question on reddit, and /u/AlGonzalez kindly gave me the solution:

Use the geddski.macros extension to bind the two commands to a key combo:

Add the following macro to settings.json:

  "macros": {
    "commentLine": [
      "editor.action.commentLine",
      "cursorDown"
    ]
  }

Then map a key in keybindings.json:

  {
    "key": "ctrl+numpad_divide",
    "command": "macros.commentLine",
    "when": "editorTextFocus && !editorReadonly"
  }
Categories: Uncategorized Tags: , ,