Skip to content

Instantly share code, notes, and snippets.

View DannyFeliz's full-sized avatar

Danny Feliz DannyFeliz

View GitHub Profile
function getCards() {
const currentDate = new Date();
const month = currentDate.getMonth() + 1;
const formattedMonth = month < 10 ? `0${month}` : month;
const thisMonth = `${currentDate.getFullYear()}-${formattedMonth}`;
const cards = document.querySelectorAll(
`[name="tempoAllocationCard"][data-date^="${thisMonth}"]`
);
return cards;
@DannyFeliz
DannyFeliz / job_grades_table.sql
Created September 2, 2017 21:31
JOB_GRADES TABLE - ORACLE
CREATE TABLE job_grades (
grade CHAR(1),
lowest_sal NUMBER(8,2) NOT NULL,
highest_sal NUMBER(8,2) NOT NULL
);
ALTER TABLE job_grades
ADD CONSTRAINT jobgrades_grade_pk PRIMARY KEY (grade);
INSERT INTO job_grades VALUES ('A', 1000, 2999);
mqtt:
enabled: false
go2rtc:
streams:
test:
- rtsp://admin:mangato1@10.0.0.201:554/h264Preview_01_main
ffmpeg:
hwaccel_args: preset-vaapi
blueprint:
name: Alexa Media Player TTS/Announce from Lovelace UI
description: Send a notification (TTS/Announcment) via the Lovelace-Ui with the help of a input select and input text. Uses the TTS component from Alexa Media Player which can be installed from the Home Assistant Community Store (HACS).
domain: automation
input:
message:
name: Message of the notification (Input Text)
description: Input text where the message comes from
selector:
entity:
# https://www.youtube.com/watch?v=Vg8lnG2lKSM
Auto Rename Tag: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
Better Comments: https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
change-case: https://marketplace.visualstudio.com/items?itemName=wmaurer.change-case
Code Spell Checker: https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker
Spanish - Code Spell Checker: https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker-spanish
Duplicate action: https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-duplicate
Error Lens: https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens
file-icons: https://marketplace.visualstudio.com/items?itemName=file-icons.file-icons
GitHub Copilot: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
@DannyFeliz
DannyFeliz / alarmo.yaml
Last active June 30, 2023 01:01
alarmo.yaml
blueprint:
name: Alarmo Keypad Sync with nightmode
description: Keypad sync with Alarmo added nightmode
domain: automation
input:
state_topic:
name: MQTT State Topic of your Zigbee2MQTT Keypad
description: "The State Topic is composed of your Zigbee2MQTT base_topic (see your Z2M Addon Configuration) and the Friendly Name of your keypad in Z2M. Example: zigbee2mqtt/Keypad"
selector:
type: custom:auto-entities
card:
show_header_toggle: false
title: Running Automations
type: entities
filter:
include:
- domain: automation
attributes:
current: '! 0'
@DannyFeliz
DannyFeliz / validar_cedula.cs
Created July 9, 2016 23:53
valida cedula
public static bool validaCedula(string pCedula)
{
int vnTotal = 0;
string vcCedula = pCedula.Replace("-", "");
int pLongCed = vcCedula.Trim().Length;
int[] digitoMult = new int[11] { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1 };
if (pLongCed < 11 || pLongCed > 11)
return false;
@DannyFeliz
DannyFeliz / agenda.md
Last active March 11, 2022 15:57
ejercicio agenda para estudiantes

Agenda

  • Realizar una agenda de contactos que cuente con el siguiente menú:

Bienvenido a la Agenda

  • 1 - Listado de Contactos (4)
  • 2 - Crear Contactos
  • 3 - Eliminar Contactos
  • 4 - Salir de la Agenda