Skip to content

Instantly share code, notes, and snippets.

View MatiasPujado's full-sized avatar
Improving skills

Matias Pujado MatiasPujado

Improving skills
View GitHub Profile
@MatiasPujado
MatiasPujado / styles.css
Created January 15, 2022 12:44 — forked from pburtchaell/styles.css
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@MatiasPujado
MatiasPujado / viewport-units-ios.scss
Created January 15, 2022 12:45 — forked from BenMorel/viewport-units-ios.scss
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
@MatiasPujado
MatiasPujado / sources.list
Created January 24, 2022 13:16
Debian 11 - Bullseye sources.list
# Main
deb https://deb.debian.org/debian bullseye main contrib non-free
deb-src https://deb.debian.org/debian bullseye main contrib non-free
# Security
deb https://security.debian.org/debian-security bullseye-security main contrib non-free
deb https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
# Updates
@MatiasPujado
MatiasPujado / Correct_GnuPG_Permission.sh
Created April 10, 2022 07:00 — forked from oseme-techguy/Correct_GnuPG_Permission.sh
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@MatiasPujado
MatiasPujado / multiple-ssh-keys-git.adoc
Created August 30, 2022 16:47 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@MatiasPujado
MatiasPujado / generate-ssh-key.sh
Created December 2, 2022 03:10 — forked from denisgolius/generate-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@MatiasPujado
MatiasPujado / nvm-commands
Created December 25, 2022 17:44
NVM list of commands
// Install a specific version number
nvm install 8.0.0
// Install the latest LTS version
nvm install --lts
// Use the latest available 8.0.x release
nvm use 8.0
// Use the latest LTS version
nvm use --lts
// Run app.js using node 6.10.3
nvm run 6.10.3 app.js
@MatiasPujado
MatiasPujado / settings.json
Last active February 8, 2023 01:25
.vscode/settings.json VSCode Workspace Settings
{
//VSCode
"extensions.ignoreRecommendations": true,
"files.autoSave": "onFocusChange",
"liveServer.settings.donotVerifyTags": true,
"redhat.telemetry.enabled": true,
"rsp-ui.enableStartServerOnActivation": [
{
"id": "redhat.vscode-community-server-connector",
"name": "Community Server Connector",