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
global.io.on('connection', (socket) => { | |
socket.setMaxListeners(20); | |
console.log('index connected') | |
socket.emit('notification', { | |
unread: 2, | |
list: [{ | |
requestor: { | |
name: 'hello', | |
id: 'word', | |
avatar:'https://semantic-ui.com/images/avatar2/small/rachel.png' |
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
$(document).ready(function () { | |
// socket.io | |
let socket = io.connect(window.location.href,{'forceNew':true }); | |
// notification | |
socket.on('notification', function(data){ | |
notification(data) | |
}); | |
// end socket io | |
}); |
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 express from "express" | |
import next from "next" | |
import bodyParser from "body-parser" | |
import cookieParser from "cookie-parser" | |
import dotenv from "dotenv" | |
import jwt from "jsonwebtoken" | |
import lusca from "lusca" | |
import moment from "moment" | |
import helmet from "helmet" | |
import Auth from "./tools/Auth" |
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, { Component, PropTypes } from "react" | |
import { Form, FormGroup, Label, Button, Input, InputGroup, InputGroupAddon, InputGroupText } from "reactstrap" | |
export default class Login extends React.Component { | |
render() { | |
return ( | |
<Form className="was-validated"> | |
<InputGroup className="mb-3"> | |
<InputGroupAddon addonType="prepend"> | |
<InputGroupText> |
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
exports.post = (urlPath, postData, callback) => { | |
axios.post(urlPath, qs.stringify(postData),{ | |
headers: {'X-Requested-With': 'XMLHttpRequest'}, | |
xsrfCookieName:'csrftoken', | |
xsrfHeaderName:'csrf-token', | |
data:postData | |
}) | |
.then(function (response) { | |
callback(response) |
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
# copy default OpenSSL config | |
cp /usr/local/etc/openssl/openssl.cnf . | |
# make changes according to https://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/ | |
vim openssl.cnf | |
# [alt_names] | |
# DNS.1 = localhost | |
# IP.1 = 0.0.0.0 | |
# IP.2 = 127.0.0.1 |
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
export const toggleConfig = key => ({ type: "TOGGLECONFIG", key }) | |
const initialState = { | |
darkMode: false, | |
element: true, | |
compare: true, | |
god: true, | |
immortal: true, | |
trieu: true, | |
yTuong: true, | |
tangBo: true, |
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 { children } = this.props | |
const childrenWithProps = React.Children.map(children, child => | |
React.cloneElement(child,{color:this.props.color}) | |
) |
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 tomorrow(str) { | |
var r = [] | |
var d = new Date(str) | |
d.setDate(d.getDate() + 1) | |
r["year"] = d.getFullYear() | |
r["month"] = d.getMonth() + 1 | |
r["day"] = d.getDate() | |
return r | |
} |
OlderNewer