next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt| package main | |
| import ( | |
| "bytes" | |
| "html/template" | |
| "log" | |
| gomail "gopkg.in/gomail.v2" | |
| ) |
| Reddit Content Policy | |
| Reddit is a platform for communities to discuss, connect, and share in an open environment, home to some of the most authentic content anywhere online. | |
| 151/5000 | |
| Reddit သည်လူမှုအသိုင်းအဝိုင်းများအတွက်အွန်လိုင်းပေါ်တွင်မည်သည့်စစ်မှန်မှုနှင့်ပါတ်သက်သည့်အကြောင်းအရာကိုမျှဝေရန်ပွင့်လင်းသောပတ်ဝန်းကျင်တွင်ဆွေးနွေးခြင်း၊ ဆက်သွယ်ခြင်းနှင့်မျှဝေခြင်းများအတွက်ပလက်ဖောင်းတစ်ခုဖြစ်သည်။ |
| Pulish a content policy | |
| Access the risks before monetizing | |
| Monitor your pages | |
| Ask your users to report violations | |
| Build, or use an automated content filtering system | |
| Use a 3rd party plugin for commenting |
| // Copyright (c) 2017 Ismael Celis | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all |
| Add the `replication` section to the mongod.conf file: | |
| ``` | |
| $cat /usr/local/etc/mongod.conf | |
| systemLog: | |
| destination: file | |
| path: /usr/local/var/log/mongodb/mongo.log | |
| logAppend: true | |
| storage: | |
| engine: mmapv1 |
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |
| package main | |
| import ( | |
| "flag" | |
| "log" | |
| "net/http" | |
| "strings" | |
| ) | |
| // FileSystem custom file system handler |
| import { withRouter } from 'next/router'; | |
| import Link from 'next/link'; | |
| import React, { Children } from 'react'; | |
| const ActiveLink = ({ router, children, ...props }) => { | |
| const child = Children.only(children); | |
| let className = child.props.className || ''; | |
| if (router.pathname === props.href && props.activeClassName) { | |
| className = `${className} ${props.activeClassName}`.trim(); |