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
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands | |
#based on my YouTube video | |
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build | |
#login to server | |
ssh root@ip_address | |
#Upgrade Server - may take a few minutes | |
sudo apt update | |
sudo apt upgrade |
Thanks to @jogerj and @PrimeCicada for the method! Original script: https://gist.github.com/jogerj/0339e61a92e0de2e360c5212a94854e8
Thanks to @SleepingPanda for 3.8 change info
Open powershell, then copy paste this script:
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
// Backend | |
import formidable from 'formidable'; | |
export const config = { | |
api: { | |
bodyParser: false, | |
}, | |
}; | |
export default async (req, res) => { |
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
// References used: | |
// - https://yesviz.com/devices.php | |
// - https://ricostacruz.com/til/css-media-query-breakpoints | |
// - https://tailwindcss.com/docs/responsive-design/#customizing-breakpoints | |
screens: { | |
'2xs': { min: '300px' }, | |
xs: { max: '575px' }, // Mobile (iPhone 3 - iPhone XS Max). | |
sm: { min: '576px', max: '897px' }, // Mobile (matches max: iPhone 11 Pro Max landscape @ 896px). | |
md: { min: '898px', max: '1199px' }, // Tablet (matches max: iPad Pro @ 1112px). | |
lg: { min: '1200px' }, // Desktop smallest. |
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: http://dis.4chan.org/read/prog/1295544154/170 | |
function sleepSort(list, callback) { | |
const result = []; | |
list.forEach((i) => setTimeout(() => { | |
result.push(i); | |
if (result.length == list.length) { | |
callback(result); | |
} |
If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:
- We define variables with
let
andconst
statements. For the purposes of the React documentation, you can consider them equivalent tovar
. - We use the
class
keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value ofthis
in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from base64 import * | |
Rcon = ( | |
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, | |
0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, | |
0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, | |
0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, | |
0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, | |
0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, |
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 javax.crypto.Cipher; | |
import java.io.InputStream; | |
import java.security.*; | |
import java.util.Base64; | |
import static java.nio.charset.StandardCharsets.UTF_8; | |
public class RsaExample { | |
public static KeyPair generateKeyPair() throws Exception { | |
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); |
NewerOlder