Skip to content

Instantly share code, notes, and snippets.

View SamChenYu's full-sized avatar
🗿

Sam Chen Yu SamChenYu

🗿
View GitHub Profile
// Nebula geometry in a custom region
const nebulaGeometry = new THREE.BufferGeometry();
const nebulaCount = 10000;
const positions = new Float32Array(nebulaCount * 3);
for (let i = 0; i < nebulaCount; i++) {
positions[i * 3] = THREE.MathUtils.randFloat(-40, 0); // x
positions[i * 3 + 1] = THREE.MathUtils.randFloat(-10, 10); // y
positions[i * 3 + 2] = THREE.MathUtils.randFloat(-300, -1500); // z
}

Code Quality and Naming Conventions

To maintain consistency and clarity in our codebase, we follow these naming conventions:

Naming Conventions

  • Objects:
    • Use Capital Camel Case (also known as Pascal Case).
    • Example: CapitalObject, UserAccount
@SamChenYu
SamChenYu / routes.js
Created March 24, 2025 16:48
NextJS manual Google OAuth
import NextAuth from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
import CredentialsProvider from 'next-auth/providers/credentials';
import { SessionStrategy } from 'next-auth';
//import bcrypt from 'bcrypt';
if (!process.env.GOOGLE_CLIENT_ID || !process.env.GOOGLE_CLIENT_SECRET || !process.env.NEXTAUTH_SECRET) {
throw new Error("Missing Google OAuth environment variables.");
}
git ls-files '*.java' | ForEach-Object { (Get-Content $_ | Measure-Object -Line).Lines } | Measure-Object -Sum