Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| import React, { useEffect } from 'react'; | |
| import { login, logout, handleRedirectCallback, getToken } from './auth'; | |
| const App = () => { | |
| useEffect(() => { | |
| handleRedirectCallback(); | |
| }, []); | |
| const handleLogin = async () => { | |
| await login(); |
| var jsData = { | |
| tabs: { | |
| home: 'HOME', | |
| explore: 'EXPLORE', | |
| sell: 'SELL', | |
| blogs: 'BLOGS', | |
| profile: 'PROFILE', | |
| }, | |
| homeScreen: { | |
| title: 'Pashushala', |
| const MAC_REGEX = '^[a-zA-Z0-9]{12}$'; | |
| const IP_REGEX = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; | |
| const PORT_REGEX = '(?::+(\\d{2,4}))?'; | |
| const IP_PORT_REGEX = `(${IP_REGEX})${PORT_REGEX}`; | |
| const MAC_IP_PORT_REGEX = `(^${MAC_REGEX}$)|(^${IP_PORT_REGEX}$)`; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="findLongestConseqSubseq"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> |
Collection of Links about GraphQL
Main site: http://graphql.org/
| ref: https://medium.com/bam-tech/generate-your-react-native-app-icons-in-a-single-command-line-145af2e329b2 | |
| remove alpha: | |
| convert image.png -background white -alpha remove white.png |
| function dedup(arr) { | |
| var hashTable = {}; | |
| return arr.filter(function (el) { | |
| var key; | |
| if (Object.prototype.toString.call(el) === "[object Object]") { | |
| key = JSON.stringify(Object.keys(el).sort()); | |
| Object.keys(el).forEach(function(i){ | |
| key += JSON.stringify(el[i]); | |
| }); | |
| } else { |
| $(document).ready(function() { | |
| $('.small-img img').each(function() { | |
| var maxWidth = 100; // Max width for the image | |
| var maxHeight = 100; // Max height for the image | |
| var ratio = 0; // Used for aspect ratio | |
| var width = $(this).width(); // Current image width | |
| var height = $(this).height(); // Current image height | |
| // Check if the current width is larger than the max | |
| if(width > maxWidth){ |
| $openssl genrsa -out client-key.pem 2048 | |
| $openssl req -new -key client-key.pem -out client.csr | |
| $openssl x509 -req -in client.csr -signkey client-key.pem -out client-cert.pem |