Skip to content

Instantly share code, notes, and snippets.

View mjcarnaje's full-sized avatar

Michael James Carnaje mjcarnaje

View GitHub Profile
@mjcarnaje
mjcarnaje / index.py
Created June 3, 2024 03:41
connecteam time in
import logging
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
import json
import schedule
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Relofair Chat</title>
</head>
<body>
<div id="chat-container"></div>
@mjcarnaje
mjcarnaje / 4380.json
Created February 16, 2024 07:44
recipe cost calculator
"form_data": [
[
{
"form_identifier": "",
"name": "fieldname10",
"fieldlayout": "default",
"shortlabel": "",
"index": 0,
"ftype": "ffieldset",
"userhelp": "",
var ajax_window = {
ajax_url: "https://easybrandph.com/wp-admin/admin-ajax.php",
language: "en",
templates: {
line: '\n<div :style="additionalCss" class="calc-item ccb-hr" :class="lineField.additionalStyles" :data-id="lineField.alias">\n\t<div class="ccb-line" :style="getLine"></div>\n</div>\n',
html: '\n<div :style="additionalCss" class="calc-item html" :data-id="htmlField.alias" v-html="htmlContent" :class="htmlField.additionalStyles"></div>\n',
toggle:
'\n<div :style="additionalCss" class="calc-item ccb-field" :class="{required: $store.getters.isUnused(toggleField), [toggleField.additionalStyles]: toggleField.additionalStyles}" :data-id="toggleField.alias">\n\t<div class="calc-item__title">\n\t\t<span> {{ toggleField.label }} </span>\n\t\t<span class="ccb-required-mark" v-if="toggleField.required">*</span>\n\t\t<span v-if="toggleField.required" class="calc-required-field">\n\t\t\t<div class="ccb-field-required-tooltip">\n\t\t\t\t<span class="ccb-field-required-tooltip-text" :class="
DROP DATABASE project_management;
CREATE DATABASE project_management;
use project_management;
CREATE TABLE IF NOT EXISTS project (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
description VARCHAR(255),
@mjcarnaje
mjcarnaje / output.txt
Created January 8, 2023 08:05
Binary Tree Output
the tree size is: 0
inserting 1...
inserting 5...
inserting 2...
inserting 7...
inserting 4...
inserting 3...
inserting 5...
inserting 8...
inserting 9...
@mjcarnaje
mjcarnaje / doubly_linked_list.py
Last active January 8, 2023 08:11
CCC121 Doubly Linked List
# CCC121 Laboratory Exercise No. 1
# Due: January 8, 2023 (Sunday) at 11:55PM
# The definition of the class for doubly-linked link objects. This class
# definition should not be modified in any way.
class DLink:
# definition of the instance initializer method
def __init__(self, it, prevval, nextval):
# define the fields by setting their initial values
self.elementField = it
class Link:
def __init__(self):
self.value = None
self.nextLink = None
def setValue(self, value):
self.value = value
def setNext(self, nextLink):
self.nextLink = nextLink
@mjcarnaje
mjcarnaje / check_if_a_number_is_odd_or_even.py
Last active August 18, 2022 07:07
Python Simple Programs
# Python program to check if the input number is odd or even.
# A number is even if division by 2 gives a remainder of 0.
# If the remainder is 1, it is an odd number.
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
def main():
books = [
{
'title': 'The Giver',
'author': 'Lois Lowry',
'isBorrowed': False
},
{
'title': 'The Hunger Games',
'author': 'Suzanne Collins',