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
## Install Docker for Ubuntu 22.04 | |
sudo apt-get update | |
sudo apt-get install ca-certificates curl | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
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
# Use a large Node.js base image to build the application and name it "build" | |
FROM node:18-alpine as build | |
WORKDIR /app | |
# Copy the package.json and package-lock.json files into the working directory before copying the rest of the files | |
# This will cache the dependencies and speed up subsequent builds if the dependencies don't change | |
COPY package*.json /app | |
# You might want to use yarn or pnpm instead |
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 { useFetch } from "#app"; | |
type useFetchType = typeof useFetch; | |
export const useHttp: useFetchType = (path, options = {}) => { | |
const config = useRuntimeConfig(); | |
options.baseURL = config.public.baseUrl; | |
options.onResponseError = (error) => {}; |
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 { useRuntimeConfig } from "nuxt/app"; | |
import { $fetch, FetchOptions } from "ofetch"; | |
export const useRawHttp = async (req: string, options: FetchOptions = {}) => { | |
const config = useRuntimeConfig(); | |
options.baseURL = config.public.baseUrl; // set your base url on runtime config | |
options.onResponse = ({ request, response, options }) => {}; |
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 'package:flutter/services.dart'; | |
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) | |
.then((_) { | |
runApp(const MyApp()); | |
}); | |
} |
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 { fileURLToPath, URL } from "url"; | |
import { defineConfig, loadEnv } from "vite"; | |
import vue from "@vitejs/plugin-vue"; | |
export default ({ mode }) => { | |
process.env = Object.assign(process.env, loadEnv(mode, process.cwd(), "")); | |
return defineConfig({ | |
plugins: [vue()], | |
base: process.env.VITE_BASE_DIRECTORY, // can be used now |
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
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /subDirectory | |
RewriteRule ^subDirectory/index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d |
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
/* Tailwind Override */ | |
h1 { | |
display: block; | |
font-size: 2em; | |
margin-top: 0.67em; | |
margin-bottom: 0.67em; | |
margin-left: 0; | |
margin-right: 0; | |
font-weight: bold; | |
} |
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
function fizzBuzz(index){ | |
let i = 1 | |
while(i <= index){ | |
if(i% 3 === 0 && i% 5 === 0){ | |
console.log("FizzBuzz") | |
} | |
else if (i% 3 === 0) { | |
console.log("Fizz") | |
} |
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
function weekdaysText(weekdays) { | |
function getText(arr){ | |
if(arr > weekdays.length || arr < 0){ | |
throw new Error("Invalid weekday number") | |
} else{ | |
return weekdays[arr] | |
} | |
} | |
return getText | |
} |