npm install nodemailer --save
This file contains 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
FROM php:7.2.10-apache-stretch | |
RUN apt-get update -yqq && \ | |
apt-get install -y apt-utils zip unzip && \ | |
apt-get install -y nano && \ | |
apt-get install -y libzip-dev && \ | |
a2enmod rewrite && \ | |
docker-php-ext-install pdo pdo_mysql && \ | |
docker-php-ext-configure zip --with-libzip && \ | |
docker-php-ext-install zip && \ |
This file contains 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
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char) | |
# |<---- Preferably using up to 50 chars --->|<------------------->| | |
# Example: | |
# [feat] Implement automated commit messages | |
# (Optional) Explain why this change is being made | |
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
# (Optional) Provide links or keys to any relevant tickets, articles or other resources | |
# Example: Github issue #23 |
This file contains 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
/^[a-zA-Z0-9_.+-]+@(?:(?:[a-zA-Z0-9-]+.)?[a-zA-Z]+.)?(domain.com|domain.net)$/g |
This file contains 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 React from "react" | |
import { Route, Switch } from "react-router-dom" | |
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => ( | |
<Route {...rest} render={props => ( | |
<Layout> | |
<Component {...props} /> | |
</Layout> | |
)} /> | |
) |
This file contains 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
Steps: | |
1. Install Eslint Globally | |
npm i -g eslint | |
2. Open your create-react-app react project or create one by typing | |
npx create-react-app name-of-project | |
(needs npm 5.2+) | |
3. Initiate Eslint in your project: | |
eslint --init |
This file contains 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
function downloadImage(data, filename = 'untitled.jpeg') { | |
var a = document.createElement('a'); | |
a.href = data; | |
a.download = filename; | |
document.body.appendChild(a); | |
a.click(); | |
} | |
document.getElementById('btn-download').addEventListener("click", function(e) { | |
const canvas = document.createElement('canvas'); |
This file contains 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
function ChatScroller(props) { | |
const ref = useRef() | |
const shouldScrollRef = useRef(true) | |
useEffect(()=> { | |
if (shouldScrollRef.current) { | |
const node = ref.current | |
node.scrollTop = node.scrollheight | |
} | |
}) | |
const handleScroll = () => { |
This file contains 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 React, { useState, useEffect, useContext, createContext } from 'react' | |
import firebase from './firebase' | |
const AuthContext = createContext() | |
export const AuthProvider = ({ children }) => { | |
const auth = useProvideAuth() | |
return <AuthContext.Provider value={auth}>{children}</AuthContext.Provider> | |
} |
OlderNewer