Skip to content

Instantly share code, notes, and snippets.

View eddex's full-sized avatar
🍌
'B'+'a'+ +'a'+'a'

Marco eddex

🍌
'B'+'a'+ +'a'+'a'
View GitHub Profile
@eddex
eddex / Use LaTeX on Windows using VS Code.md
Last active September 29, 2021 13:10
How to install everythin needed to write and compile LaTeX documents on Windows using VS Code

Use LaTeX on Windows using VS Code

The following steps are a guide to install TeXLive and the LaTeX-Workshop VS Code extension

  1. Install VS Code
  2. Download the TeXLive installer for Windows.
  3. Run the installer (takes ~1h)
  4. Restart your Computer! Otherwise VS Code doesn't find latexmk in the PATH for some reason.
  5. Install the LaTeX Workshop Extension
  6. Install the Code Spell Checker Extension for your language.
  7. Done. Open a .tex file and use CTRL+ALT+b to compile.
@eddex
eddex / Install CUDA 10.1 on Ubuntu 18.04.md
Last active November 22, 2023 16:12
How to install CUDA 10.1 on Ubuntu 18.04

How to install CUDA 10.1 on Ubuntu 18.04

A clean installation of Ubuntu 18.04.02 LTS was used.

This gist is an extension to the official docs, adding missing parts and instructions.

2 pre-install actions

follow the pre-installation actions on:

@eddex
eddex / node.js_output_to_file.txt
Created May 1, 2017 14:02
redirect node.js console output to file
Just run the script in your terminal like this...
node script-file.js > log-file.txt
This tells the shell to write the standard output of the command node script-file.js to your log file instead of the default, which is printing it to the console.
This is called redirection and its very powerful. Say you wanted to write all errors to a separate file...
node script-file.js >log-file.txt 2>error-file.txt
Now all console.log are written to log-file.txt and all console.error are written to error.txt
@eddex
eddex / node.js_epoch_timestamp.js
Created April 24, 2017 12:28
convert epoch (unix) timestamp to a readable format (node.js)
/*
* Convert the epoch (unix) timestamp to a readable format.
*/
function formatDateTime(epochTimeStamp, callback) {
var d = new Date(epochTimeStamp * 1000);
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var year = d.getFullYear();
var month = months[d.getMonth()];
var date = d.getDate();
var hour = d.getHours();
@eddex
eddex / node.js_object_inspect.js
Last active April 24, 2017 12:28
how to debug log full object in Node.js
const util = require('util')
console.log(util.inspect(myObject, {showHidden: false, depth: null}))
// alternative shortcut
console.log(util.inspect(myObject, false, null))