Coding tips

Customize Latex Workshop external viewer

In Vscode the following configuration works well with Latex workshop.

Sumatra

{
    "latex-workshop.view.pdf.viewer": "external",
    "latex-workshop.view.pdf.external.viewer.command": "C:\\Program Files\\SumatraPDF\\SumatraPDF.exe",
    "latex-workshop.view.pdf.external.viewer.args": [
        "%PDF%"
    ],
    "latex-workshop.view.pdf.external.synctex": "sumatrapdf",
    "latex-workshop.view.pdf.external.synctex.args": [
    "-forward-search",
    "%TEX%",
    "%LINE%",
    "-reuse-instance",
    "-inverse-search",
    "\"C:\\Users\\<Username>\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"C:\\Users\\<U>\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\cli.js\" --ms-enable-electron-run-as-node -r -g \"%f:%l\"",
    "%PDF%"
  ]
}

Sioyek

{
    "latex-workshop.view.pdf.external.viewer.command": "C:\\path\\to\\sioyek\\sioyek.exe",
    "latex-workshop.view.pdf.external.synctex.command": "C:\\path\\to\\sioyek\\sioyek.exe",
    "latex-workshop.view.pdf.external.synctex.args": [
        "--inverse-search",
        "\"C:\\path\\to\\vscode\\Code.exe\" \"C:\\path\\to\\vscode\\resources\\app\\out\\cli.js\" --ms-enable-electron-run-as-node -r -g \"%1:%2\"",
        "--reuse-instance",
        "--forward-search-file",
        "%TEX%",
        "--forward-search-line",
        "%LINE%",
        "%PDF%"
    ]
}

Biblatex bibliography trick

To change the url biblatex entry string from retrieved from to available at, do this:

\DefineBibliographyStrings{english}{%
   retrieved = {available},
   from = {at},
}

Create a new sveltekit project

pnpm dlx sv create my-app
cd my-app
git init && git add -A # (optional)
pnpm run dev

How to install strapi

pnpm dlx create-strapi-app@latest

See strapi.io for details.

Clone only the latest commit of a Git repository

git clone --depth 1 <url>

If you need an specific commit, you can obtain it with the git checkout command:

git checkout <commit_hash>

Source

  1. Bing AI Chat, 21/9/2023.
  2. Copie un repositorio de git sin historial - QA Stack.
  3. Clonar repositorio remoto de git hasta cierto commit.
  4. Regresar un repositorio a un commit especifico - Stack Overflow.
  5. Atlassian Git Tutorial.

Edit Git Remote URL

git remote set-url origin <new-url>

Source

Django tests not running

Solution. Make sure you are writing your tests wrapped in classes that inherit from TestCase. Example:

from django.test import TestCase


class FooTest(TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_this_will(self):
        print 'Win'

Read more


Children
  1. Code Snippets
  2. Coding tips for the R programming language
  3. Julia
  4. Power Shell
  5. Python
  6. Ruby