Skip to content

Instantly share code, notes, and snippets.

View magnum's full-sized avatar
💭
experimenting...

Antonio Molinari magnum

💭
experimenting...
View GitHub Profile
@magnum
magnum / linux-setup.sh
Created April 27, 2024 00:10 — forked from dhh/linux-setup.sh
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@magnum
magnum / gist:e69d34d0e9ebabcbe12ada94c78e9549
Created October 6, 2023 19:25 — forked from Prezens/gist:f99fd28124b5557eb16816229391afee
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
@magnum
magnum / SSL.md
Created July 25, 2022 21:41 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@magnum
magnum / fiddle.css
Created July 16, 2021 13:12 — forked from stuk88/fiddle.css
Paper detection
.image:after {
display: block;
position: absolute;
width: 70%;
height: 70%;
border: 10px solid red;
}
video
{
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@magnum
magnum / app assets javascripts rails_admin actions create_aliada_working_hours.js A complete rails admin custom action, the file of this gist are the paths were you should put your files
alert('omg hi!')
@magnum
magnum / tmux.conf
Created November 29, 2019 16:19 — forked from algesten/tmux.conf
A tmux.conf with pbcopy
# propagate titles to the window
set -g set-titles on
# Minimalist window title "0:bash"
set -g set-titles-string "#I:#W"
# show colors
set -g default-terminal "screen-256color"
BEGIN:VCARD
VERSION:3.0
N:qrd°by;
FN:qrd°by
TEL;WORK:+43 (0)1997 2742-0
EMAIL;INTERNET:office@qrd.by
ADR;INTL;PARCEL;WORK;CHARSET=utf-8:;;Deublergasse 37;Vienna;;1210;Austria;
END:VCARD
@magnum
magnum / gsap-properties-cheat-sheet.md
Created January 15, 2019 10:36 — forked from lunelson/gsap-properties-cheat-sheet.md
Greensock Properties Cheat Sheet

Greensock CSS properties Cheat Sheet

I wrote this as a reference for myself because some of the property names are non-obvious, and there are a number of relevant special properties, and there is no central concise listing of them all in GSAP Docs, other than (in longer form) on the CSSPlugin page.

Standard CSS properties

...are all supported, with hyphenated-names becoming camelCaseNames. Non-animatable properties are also supported but they will be set at the beginning of the tween.

Special mentions: