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
| 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
httpsinstead 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
| var crypto = require('crypto'); | |
| var SaltLength = 9; | |
| function createHash(password) { | |
| var salt = generateSalt(SaltLength); | |
| var hash = md5(password + salt); | |
| return salt + hash; | |
| } |
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
| .eui-item-text-see-more { | |
| color: #9a9b9b; | |
| line-height: 20px; | |
| cursor: pointer; | |
| transition: color 0.2s ease; | |
| white-space: nowrap; | |
| } | |
| .eui-item-text-see-more:hover { | |
| color: #17191a; | |
| } |
OlderNewer