Skip to content

Instantly share code, notes, and snippets.

View jay754's full-sized avatar
🐱
sup

Jay Engineer jay754

🐱
sup
  • /dev/null
View GitHub Profile
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Get started by editing&nbsp;
<code className="font-mono font-bold">app/page.tsx</code>
</p>
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:size-auto lg:bg-none">
<a
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign
next js commands
npx create-next-app@latest
npm run dev
default component
export default function Home() {
return (
react native commands
npx create-react-native-app test
npx create-expo-app StickerSmash --template blank
https://docs.expo.dev/tutorial/create-your-first-app/ - follow this if you want to create with app.js
# for creating react native apps
npx create-expo-app --template -> pick barebones
# invoke a function
sls invoke -f methodName
# deploy
sls deploy
sls deploy -v => for verbose
# pass data
[default]
aws_access_key_id = xxx
aws_secret_access_key = xxx
[adminuser]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1
command for serverless config
''' docker manages single containers
docker-compose manages multiple container applications
Usage of docker-compose requires 3 steps:
Define the app environment with a Dockerfile
Define the app services in docker-compose.yml
Run docker-compose up to start and run app '''
Docker Commands
$ swiftc hello.swift
$ ./hello
Hello world
American Express
FPAN: 3499 569590 41362
Expiration Date: 12/2022
CID: 1111
Discover
FPAN: 6011 0009 9446 2780
Expiration Date: 11/2022
CID: 111
Option 1: Redirect www to non-www
server {
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
Option 2: Redirect non-www to www
server {
# Command 1: recursively looking for a file in a server.
Example:
find . -name "foo*"
# Command 2: Reading a log file in real time
Example:
tail -f path_to_Log
# Command 3: Empty a file without deleting it
Example: