Example of how Sockets work in Java
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 9 columns, instead of 8. in line 6.
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
Name,Frontend,Backend,Storage,Database,Socket,Developer Experience,Positive Notes,Negative Notes | |
AWS,✅ (S3 + CloudFront),✅ (Lambda / Fargate / Elastic BeansTalk),✅ (S3),"✅ (DynamoDB, RDS)",✅,⚠️,"Robust platform, Serverless framework can usually make deployments easier","Costs are often hard to predict, relational DBs are pricey while structuring data with DynamoDB might be complex, the Serverless framework is nice but has some bugs (e.g. serverless-offline plugin postToConnection is not currently working)" | |
BackBlaze,✅,❌,✅,❌,❌,✅,"Cheap storage solution, part of CloudFlare Bandwidth Alliance",Slightly slower than S3 | |
CloudFlare,✅ (Pages),✅ (Workers),✅ (R2), ❌,✅,✅,"Edge Computing, competitive pricing","Workers run in a V8 environment, so many Node.js packages won't work" | |
Deta,❌,✅,✅,✅,❌,✅,It's free to use,Still experimental-ish | |
Digital Ocean,✅ (App Platform),✅ (App Platform),✅ (Spaces),✅ (Managed DB),✅ (needs Redis),✅,Predictable pricing,High costs | |
FaunaDB,❌,❌,❌,✅,❌,⚠️,Horizontally scalable and globally distribute |
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
#!/bin/bash | |
TEMPLATE="$( | |
cat <<-EOF | |
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "$DB_PROVIDER" | |
url = env("DB_URI") |
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 puppeteer from "puppeteer" | |
let browser: puppeteer.Browser | undefined | |
let page: puppeteer.Page | undefined | |
const sleep = async (ms: number) => | |
await new Promise((res) => setTimeout(res, ms)) | |
beforeAll(async () => { | |
browser = await puppeteer.launch({ |
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
// Declaring our Custom Element class. | |
// NOTE: element classes can extend to | |
// HTMLElement, HTMLButtonElement, HTMLParagraphElement, ... | |
class ClockElement extends HTMLElement { | |
// First method that will be | |
// executed on object initialization | |
constructor() { | |
// Run HTMLElement's constructor to setup basic stuff | |
super() |
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 JsonWebToken = require("jsonwebtoken") | |
const BodyParser = require("body-parser") | |
const Bcrypt = require("bcryptjs") | |
const Database = require("./db") | |
const SERVER_PORT = process.env.PORT || 80 | |
const SECRET_JWT_CODE = "psmR3HuOihHKfqZymo1m" |
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 java.io.File; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
public class DSStoreRemover { | |
private static final ArrayList<File> filesArrayList = new ArrayList<>(); | |
public static void main(String[] args) { | |
System.out.println("Drag & Drop folder here: "); |
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 java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
public class LinesCounter { | |