Skip to content

Instantly share code, notes, and snippets.

View kayode-adechinan's full-sized avatar

Kayode Adechinan kayode-adechinan

  • Dakar, Senegal
View GitHub Profile
// The custom replacement button function
function custom_product_button(){
// HERE your custom button text and link
$button_text = __( "WhatSapp", "woocommerce" );
$button_link = "https://web.whatsapp.com/send?phone=+221785421818&text=Votre%20annonce%20publi%C3%A9e%20sur%20AdafriMarket%20m%27int%C3%A9resse.%20https://sn.coinafrique.com/annonce/demandes-demploi/demande-demploi-boy-2512208";
// Display button
echo '<a class="button" target="_blank" href="'.$button_link.'">' . $button_text . '</a>';
}
@kayode-adechinan
kayode-adechinan / psql-error-fix.md
Created April 17, 2020 12:51 — forked from AtulKsol/psql-error-fix.md
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

quickstart

import React, { Component } from "react";
import axios from "axios";

class Row extends Component {
  render() {
    return (
      <tr>
const loadDynamicScript = (src, callback) => {
const existingScript = document.getElementById('scriptId');
if (!existingScript) {
const script = document.createElement('script');
script.src = src; // URL for the third-party library being loaded.
//script.id = 'libraryName'; // e.g., googleMaps or stripe
document.body.appendChild(script);
script.onload = () => {
// login.jsx
import React, { Component } from "react";
import cookie from 'js-cookie'
import Router from 'next/router'
export default class Login extends Component {
import React, { Component } from "react";
export default class Foo extends Component {
state = {
status: ""
};
componentDidMount() {
this.setState({ status: localStorage.getItem("status") });
}
import React from 'react'
import {useFormik} from 'formik'
export default function Register(){
function validate(values){
const errors = {}
if(!values.firstName){
errors.firstName = "Required"
}
if(!values.lastName){
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="root"></div>
<script language="JavaScript">
/**
* Disable right-click of mouse, F12 key, and save key combinations on page
* By Arthur Gareginyan (arthurgareginyan@gmail.com)
* For full source code, visit https://mycyberuniverse.com
*/
window.onload = function() {
document.addEventListener("contextmenu", function(e){
e.preventDefault();
}, false);

hide until vue get loaded

[v-cloak] {
  display: none;
}
<div v-cloak>
  {{ message }}
</div>