Skip to content

Instantly share code, notes, and snippets.

View arbaouimehdi's full-sized avatar
🎯
focusing

Arbaoui Mehdi arbaouimehdi

🎯
focusing
View GitHub Profile
@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
@arbaouimehdi
arbaouimehdi / multiple_ssh_setting.md
Last active June 21, 2019 23:41 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@arbaouimehdi
arbaouimehdi / gatsby-config.js
Last active June 17, 2019 14:50
Gatsby Source Wordpress Config
// In your gatsby-config.js
module.exports = {
plugins: [
/*
* Gatsby's data processing layer begins with “source”
* plugins. Here the site sources its data from Wordpress.
*/
{
resolve: "gatsby-source-wordpress",
options: {