This file contains hidden or 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 | |
| # EOL Website Deployment Script | |
| # Compatible with macOS and Linux | |
| # Usage: ./deploy.sh [environment] | |
| # Environment: staging (default) | production | |
| set -e # Exit on any error | |
| # Check if we're on macOS |
This file contains hidden or 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 | |
| # Function to bump version number in a string (e.g., 2.3 → 2.4) | |
| bump_version() { | |
| local version=$1 | |
| local major=$(echo $version | cut -d. -f1) | |
| local minor=$(echo $version | cut -d. -f2) | |
| minor=$((minor + 1)) | |
| echo "$major.$minor" | |
| } |
This file contains hidden or 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
| version: "3.8" | |
| services: | |
| mysql: | |
| platform: linux/x86_64 # Add this line to ensure compatibility | |
| image: mysql:8.0 | |
| command: --default-authentication-plugin=mysql_native_password | |
| environment: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: mysqldb |
This file contains hidden or 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 | |
| # Delete the current firewall setup: | |
| iptables -F | |
| # Define default rules for all chains: | |
| iptables -P INPUT DROP | |
| iptables -P FORWARD DROP | |
| # Allow incoming/outgoing localhost frames for tests (e.g. Webserver, Mailserver): |
This file contains hidden or 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 tryCatch<T>(fn: () => T, andFinally?: () => void): Result<T, string> { | |
| try { | |
| return Ok(fn()); | |
| } catch (err) { | |
| return Err(`Fn threw an error ${err}`); | |
| } finally { | |
| andFinally?.(); | |
| } | |
| } |
This file contains hidden or 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
| interface SomeType<T> { | |
| type: "some"; | |
| value: T; | |
| /*** Returns the value of the Option if it exists, otherwise throws an error.*/ | |
| unwrap(): T; | |
| /*** Returns the value of the Option if it exists, otherwise returns the provided default value.*/ | |
| unwrapOr(defaultValue: T): T; | |
| /*** Returns the value of the Option if it exists, otherwise calls the provided function and returns its result.*/ | |
| unwrapOrElse(fn: () => T): T; | |
| /*** Returns true if the Option contains a value, false otherwise.*/ |
This file contains hidden or 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 Component from "./Component"; | |
| import "./styles.css"; | |
| import { useState } from "react"; | |
| import { Check, Random } from "./random"; | |
| /** | |
| * @Question | |
| *Implement a theme switcher.that can switch between themes in entire application. | |
| */ |