Skip to content

Instantly share code, notes, and snippets.

View arbaouimehdi's full-sized avatar
🎯
focusing

Arbaoui Mehdi arbaouimehdi

🎯
focusing
View GitHub Profile
//Self-Signed Certificate for using with VS Code Live Server
//Save both files in a location you will remember
1. create a private key
openssl genrsa -aes256 -out localhost.key 2048
// you will be prompted to provide a password
//this will create localhost.key (call it whatever you like)
2. create the certificate

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@arbaouimehdi
arbaouimehdi / _size_calculator.scss
Created July 25, 2021 10:35
Calculate Size Sass Utilities
// =============================================================================
// Calculate Size
// =============================================================================
// Strip Unit
// -----------------------------------------------------------------------------
//
// Removes the unit (e.g. px, em, rem) from a value, returning the number only.
//
// -----------------------------------------------------------------------------
@arbaouimehdi
arbaouimehdi / css
Created March 28, 2021 06:14 — forked from PadreZippo/embed.html
iframes with constant aspect ratios
.ratio-16-9,
.ratio-16-10,
.ratio-square {
display: block;
position: relative;
width: 100%;
height: 0;
}
.ratio-16-9 {
@arbaouimehdi
arbaouimehdi / .stylelintrc
Created February 24, 2021 00:44 — forked from samuells/.stylelintrc
Linting SCSS files with settings for orders in logical chunks
{
"extends": [
"stylelint-config-standard",
"stylelint-config-sass-guidelines",
"./node_modules/prettier-stylelint/config.js"
],
"plugins": [
"stylelint-scss",
"stylelint-order",
"stylelint-a11y",
@arbaouimehdi
arbaouimehdi / extensions.txt
Last active September 24, 2020 13:12
VSCode Extensions List
- aaron-bond.better-comments
- bierner.lit-html
- bmewburn.vscode-intelephense-client
- christian-kohler.path-intellisense
- CodeRoad.coderoad
- codezombiech.gitignore
- CoenraadS.bracket-pair-colorizer
- donjayamanne.githistory
- dsznajder.es7-react-js-snippets
- esbenp.prettier-vscode
@arbaouimehdi
arbaouimehdi / settings.json
Last active June 21, 2020 12:14
VSCode Settings
{
"window.zoomLevel": 1,
"editor.fontFamily": "Monaco",
"editor.fontLigatures": true,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.detectIndentation": false,
"terminal.integrated.fontSize": 17,
"terminal.integrated.shell.osx": "/bin/zsh",
"workbench.iconTheme": "material-icon-theme",
/*!
* description: Format Phone Numbers
* Output: (+XXX) XXX-XXXXXX => (+212) 671-415075
* @phone
*/
function formatPhone(phoneNumber, format) {
// Replace X by each number on a specific position
for (let i = 0, l = phoneNumber.length; i < l; i++) {
format = format.replace(
@arbaouimehdi
arbaouimehdi / functions.php
Created January 26, 2020 17:31
Add a Custom Type to WordPress, and show it in GraphQL
<?php
add_action( 'init', function() {
register_post_type( 'events', [
'show_ui' => true,
'labels' => [
'menu_name' => __( 'Events', 'your-textdomain' ),//@see https://developer.wordpress.org/themes/functionality/internationalization/
],
'show_in_graphql' => true,
'hierarchical' => true,
@arbaouimehdi
arbaouimehdi / readme.md
Last active June 24, 2019 12:46
How To Set Up SSH Keys on Ubuntu

Create the RSA Key Pair

ssh-keygen

Copy the Public Key to Ubuntu Server

ssh-copy-id username@remote_host