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 type { ReactNode } from "react"; | |
import type { Props as ReactIntlFormattedMessageProps } from "react-intl/src/components/message"; | |
import { FormattedMessage as ReactIntlFormattedMessage } from "react-intl"; | |
import enMessages from "./en.json"; | |
// Our new union type of all available message IDs. | |
type IntlMessageKeys = keyof typeof enMessages; | |
// Extend the original FormattedMessage props. | |
type FormattedMessageProps = ReactIntlFormattedMessageProps< |
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
// If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950 | |
Linkedin = { | |
config: { | |
scrollDelay: 3000, | |
actionDelay: 5000, | |
nextPageDelay: 5000, | |
// set to -1 for no limit | |
maxRequests: -1, | |
totalRequestsSent: 0, |
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
const express = require("express") | |
const app = express() | |
var passport = require("passport") | |
var session = require("express-session") | |
var GitHubStrategy = require("passport-github2").Strategy | |
const GITHUB_CLIENT_ID = "your-client-id-here" // or get from process.env.GITHUB_CLIENT_ID | |
const GITHUB_CLIENT_SECRET = "your-client-secret-here" // or get from process.env.GITHUB_CLIENT_SECRET | |
const GITHUB_CALLBACK_URL = "http://localhost:5000/auth/github/callback" // or get from process.env.GITHUB_CALLBACK_URL |
How To Use React-Intl: internationalize your React app
This short tutorial assumes you know about ES6 syntax.
yarn add react-intl
or npm i --save react-intl
.
This file should contain every message for your app.
It has an object of (locale, messages) couples:
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
var inviter = {} || inviter; | |
inviter.userList = []; | |
inviter.className = 'button-secondary-small'; | |
inviter.refresh = function () { | |
window.scrollTo(0, document.body.scrollHeight); | |
window.scrollTo(document.body.scrollHeight, 0); | |
window.scrollTo(0, document.body.scrollHeight); | |
}; |
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
/* | |
C++ Program to check for balanced parentheses in an expression using stack. | |
Given an expression as string comprising of opening and closing characters | |
of parentheses - (), curly braces - {} and square brackets - [], we need to | |
check whether symbols are balanced or not. | |
*/ | |
#include<iostream> | |
#include<stack> | |
#include<string> | |
using namespace std; |
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
#include <iostream> | |
#include <cstdlib> | |
class Node | |
{ | |
public: | |
Node* next; | |
int data; | |
}; |