Skip to content

Instantly share code, notes, and snippets.

Avatar

Médédé Raymond KPATCHAA mrkpatchaa

View GitHub Profile
@mrkpatchaa
mrkpatchaa / optimize-wordpress-code-styles.php
Created Sep 29, 2021
Block-styles loading enhancements in WordPress 5.8
View optimize-wordpress-code-styles.php
add_filter('should_load_separate_core_block_assets', '__return_true');
// https://make.wordpress.org/core/2021/07/01/block-styles-loading-enhancements-in-wordpress-5-8/?source=korben.info
@mrkpatchaa
mrkpatchaa / a11y-security.css
Last active Jun 29, 2020
Accessibility and security in CSS #css
View a11y-security.css
/* Unsecure target _blank */
a[target$="blank"]:not([rel*="noopener"]):not([rel*="noreferrer"]) {
outline: 2px dotted red;
}
/* Links going nowhere */
a:is(:not([href]), [href=""], [href="#"]) {
outline: 2px dotted red;
}
View timemachinebackupx10.sh
// Before backup
sudo sysctl debug.lowpri_throttle_enabled=0
// After backup
sudo sysctl debug.lowpri_throttle_enabled=1
// From https://korben.info/comment-accelerer-jusqua-10x-la-sauvegarde-time-machine.html
@mrkpatchaa
mrkpatchaa / wifi-password.sh
Last active Jun 29, 2020
Find WIFI Password #wifi
View wifi-password.sh
# Windows
netsh wlan show profile NOM_DU_RESEAU_WIFI key=clear
# Mac
security find-generic-password -wa NOM_DU_RESEAU_WIFI
# Linux
sudo cat /etc/NetworkManager/system-connections/NOM_DU_RESEAU_WIFI | grep psk=
# From https://korben.info/une-commande-pour-retrouver-en-clair-le-mot-de-passe-dun-reseau-wifi.html
View background-size-cover-with-text-overlay.html
<html>
<style>
.overlay-image {
position: relative;
width: 900px;
height: 600px;
background: url(https://images.unsplash.com/photo-1565191999001-551c187427bb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1650&q=80) no-repeat center center fixed;
background-size: cover;
}
@mrkpatchaa
mrkpatchaa / README.md
Created Apr 10, 2019
Git Detached Head
View README.md

The intermediate steps of an interactive rebase are done with a detached HEAD (partially to avoid polluting the active branch’s reflog). If you finish the full rebase operation, it will update your original branch with the cumulative result of the rebase operation and reattach HEAD to the original branch. My guess is that you never fully completed the rebase process; this will leave you with a detached HEAD pointing to the commit that was most recently processed by the rebase operation.

To recover from your situation, you should create a branch that points to the commit currently pointed to by your detached HEAD:

git branch temp git checkout temp (these two commands can be abbreviated as git checkout -b temp)

This will reattach your HEAD to the new temp branch.

View scrollToTop.jsx
import React from 'react'
import styled from 'styled-components'
class ScrollingWrapper extends React.Component {
state = { hasScrolled: false }
componentDidMount() {
this.scrollingWrapper.addEventListener('scroll', this.onScroll)
}
@mrkpatchaa
mrkpatchaa / optimise-images-terminal.md
Created Feb 20, 2019 — forked from gielcobben/optimise-images-terminal.md
Optimise your pngs from the terminal in OSX
View optimise-images-terminal.md

JPG:
$ brew install jpegoptim
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

- PNG:
$ brew install optipng
$ find . -name "*.png" -exec optipng -o7 {} \;

View TabbingThroughInputs.js
import React from 'react';
import {
StyleSheet,
View,
TextInput,
AppRegistry,
} from 'react-native';
class App extends React.Component {
constructor(props) {