Skip to content

Instantly share code, notes, and snippets.

View luigiMinardi's full-sized avatar
🎯
Focusing

Luigi Minardi luigiMinardi

🎯
Focusing
View GitHub Profile
@luigiMinardi
luigiMinardi / tex-colors.md
Last active April 19, 2024 19:20
Github markdown colors (Using Tex and the github MathJax support)

Small warning for everyone that are thinking if using Tex colors is a good idea or not

  • 2023-05-02 - Since a few days ago \colorbox and \fcolorbox are broken and Github did't talk about if it's a temporary thing or if it will not be added back.
    • 2024-01-04 - Since it has not being added back I deduce that it will never be so I removed all mentions to it on the rest of the gist.
  • 2023-09-29 - Tex seems to not work on h1 to h6 anymore (markdown #'s)
    • 2024-01-04 - Now it works again, I'll keep the message for a while to remember that it may change again in the future

As you can se with the above message(s) Tex may not be very stable and may not be an option to you as of the dates expressed above. You can also check other tex problems here.

Github released Tex support and colors* to the markdown and you din't realized

@mttmantovani
mttmantovani / install_pyenv.sh
Created March 17, 2021 11:23
Install pyenv on Ubuntu 20.04
#!/bin/bash
sudo apt-get install git python3-pip python-is-python3 make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libffi-dev
pip install virtualenvwrapper
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
cat << EOF >> ~/.bashrc
@dungsaga
dungsaga / funny_acronym_php.md
Last active April 12, 2023 12:24
funny acronym: what does PHP stand for?

Prrr Home Page

  • Pretty Home Page (some people think this is the initial meaning of PHP)
  • Professional Homepage Power
  • Private Home Page
  • Personal Home Page (the original name in the announcement "Announce: Personal Home Page Tools (PHP Tools)")
  • Phucking Home Page

Programmable

@anichitiandreea
anichitiandreea / typescript_coding_standards.md
Last active April 29, 2024 13:57
TypeScript Code Conventions
@whoisryosuke
whoisryosuke / omit-multiple-types.ts
Created February 22, 2021 17:54
Typescript - Omit multiple properties from a property -- via: https://stackoverflow.com/a/57603792
export type ComponentProps = {
x: number;
y: number;
j: string;
k: string;
};
export type B = Omit<ComponentProps, 'j' | 'k'>
// Same as
// type B = {
@lewebsimple
lewebsimple / setup-typescript.sh
Last active March 29, 2024 07:42
TypeScript / ESLint / Prettier / Vue 3
#!/bin/bash
yarn add -D @typescript-eslint/eslint-plugin \
typescript ts-node-dev \
@typescript-eslint/parser @typescript-eslint/eslint-plugin eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue prettier
cat > .eslintrc.js <<EOF
module.exports = {
root: true,
env: {
@andrebrait
andrebrait / keychron_linux.md
Last active April 25, 2024 13:24
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@navsqi
navsqi / globalErrorSqlz.js
Created August 2, 2020 17:31
sequelize global error handling
// in models/index.js
if (sequelize) {
sequelize
.authenticate()
.then(() => {
console.log('Connection has been established successfully.');
})
.catch((err) => {
console.error('Unable to connect to the database:', err);
});
@devrishik
devrishik / PostgreSQL JSON Indexing and Django Models references
Last active January 10, 2024 17:36
A quick cook book to Postgres indexes and Django model references
Django provides references to all of the existing indexes in Postgres.
Django managers can be used for managing indexes dynamically, a handle
can be provided as IndexManager to extend for custom querysets or raw sql queries.
PostGres
--------
Types of indexes: https://www.postgresql.org/docs/9.1/indexes-types.html
BRIN: Block Range Index: good for comparing blocks with relative location data
Btree (default): @> <> =: