const pluck = key => array => Array.from(new Set(array.map(obj => obj[key])));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-04-26T06:26:34.097Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback, useRef, useState, useEffect, useMemo } from 'react'; | |
import { | |
FormApi, | |
FormState, | |
FieldState, | |
Config, | |
FormSubscription, | |
FieldSubscription, | |
FieldValidator, | |
formSubscriptionItems, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useFetch = endpoint => { | |
const defaultHeader = { | |
Accept: "application/json", | |
"Content-Type": "application/json" | |
}; | |
const customFetch = ( | |
url, | |
method = "GET", | |
body = false, | |
headers = defaultHeader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is just here to change the name of the gist | |
import React from 'react' | |
import styled from 'styled-components' | |
const makeResponsiveComponent = (rulesets, tagName = 'div') => | |
styled(tagName)`${buildStyles(rulesets)}` | |
const buildStyles = rulesets => | |
rulesets.reduce( | |
(cssString, { constraint, width, rules }) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import passport from 'passport'; | |
module.exports = app => { | |
app.get('/findUser', (req, res, next) => { | |
passport.authenticate('jwt', { session: false }, (err, user, info) => { | |
if (err) { | |
console.log(err); | |
} | |
if (info != undefined) { | |
console.log(info.message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keywords.select2({ | |
tags: true, | |
createTag: function (params) { | |
var term = $.trim(params.term); | |
var count = 0 | |
var existsVar = false; | |
//check if there is any option already | |
if($('#keywords option').length > 0){ | |
$('#keywords option').each(function(){ | |
if ($(this).text().toUpperCase() == term.toUpperCase()) { |
- Create certificate
- Config Apache to access
https
instead ofhttp
- Config mod rewrite to generate SSL url
- Config Virtual host to test site
- Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To log errors triggered by WordPress plugins, you can use the debug log. | |
Edit your wp-config.php file | |
Add the following lines to enable debug (if these are already defined, edit the values): | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); |
OlderNewer