Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding

Maverick Fabroa mavyfaby

💻
Coding
View GitHub Profile
@mavyfaby
mavyfaby / deploy.sh
Created Feb 11, 2022
Deploy Attendance Management System project
View deploy.sh
#! /bin/bash
date=$(date '+%m-%d-%Y-%I:%M:%S%p')
if [ ! -d "/home/maverick/Mavy/wmdc/backups/attendance-${date}/" ]; then
mkdir /home/maverick/Mavy/wmdc/backups/attendance-${date}/
fi
if [ "$(ls -A /var/lib/tomcat9/webapps/attendance)" ]; then
mv /var/lib/tomcat9/webapps/attendance/* /home/maverick/Mavy/wmdc/backups/attendance-${date}/
fi
@mavyfaby
mavyfaby / compile.sh
Created Feb 11, 2022
Compile Attendance Management System project
View compile.sh
#! /bin/bash
if [[ ! -d WEB-INF ]] || [[ ! -d WEB-INF/classes ]]; then
mkdir -p WEB-INF/classes
fi
cp -rf src/lib src/attendance.properties src/rewrite.config WEB-INF/
lib="src/lib/"
@mavyfaby
mavyfaby / createModels.js
Created Jan 9, 2022
Vuex 4 and Vue 3: Create models from vuex state
View createModels.js
import { computed } from "vue";
/**
* Create models from state
* @param {object} vuex state
* @returns {(object | null)} state models
*/
function createModels(state) {
// Check if state is not empty and a valid object
if (state && typeof state === "object" && state.constructor === Object) {
@mavyfaby
mavyfaby / main.py
Last active Feb 15, 2022
Bombs and $100 bills code in Python by Mavy💖
View main.py
import sys
def main(lines):
new_lines = lines[1:]
output_lines = list()
# First line workaround
first_line = lines[0].split()