Skip to content

Instantly share code, notes, and snippets.

View CristianHG2's full-sized avatar
🙃
Who needs sleep, anyway?

Cristian Herrera CristianHG2

🙃
Who needs sleep, anyway?
View GitHub Profile
@CristianHG2
CristianHG2 / developer-assessment.md
Last active February 9, 2024 21:43
OCMI Workers Comp / PEOPayGo - Developer Assessment

Evaluación del Desarrollador

Este documento contiene información sobre el escenario sugerido para nuestra evaluación en casa.

Escenario

Trabajas para PEOPayGo, un proveedor líder de nómina. Actualmente, todas las hojas de tiempo se envían manualmente, y deseas automatizarlo. Construirás una aplicación que permita a los usuarios enviar hojas de tiempo, y a los administradores ver estas entregas.

Requisitos

Tu aplicación debe contar con los siguientes módulos.

Autenticación / Autorización

@CristianHG2
CristianHG2 / fee-calculator.js
Created October 27, 2022 16:06
Calculates any fee that involves a percentage + fixed cost and outputs the amount necessary to receive that amt
const float = n => parseFloat(n.toFixed(2));
const RATE = 0.0319; // 3.19%
const FIXED_FEE = 0.49; // $0.49
const calculatePayPalFee = gross => {
return {
willReceive: float((gross - FIXED_FEE) - (gross * RATE)),
toReceive: float((gross + FIXED_FEE) / (1 - RATE))
};
@CristianHG2
CristianHG2 / react-jsx.html
Created September 5, 2022 16:59
Boilerplate for a minimal React 18 installation with JSX Support
<!doctype html>
<html lang="en">
<head>
<title>Minimal React + JSX Installation</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script crossorigin src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
@CristianHG2
CristianHG2 / LaravelCorsValetDriver.php
Created December 5, 2021 18:25
Laravel Valet Driver with Wide-Open CORS Configuration
<?php
class LaravelCorsValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
function sel(query)
{
return document.querySelector(query);
}
function getOptionVal(select, text)
{
var ret = null;
var sel = document.querySelector(select);
var vals = [];
@CristianHG2
CristianHG2 / formcreator.html
Created September 24, 2018 15:22
Basic docusign-like form creator
<!DOCTYPE html>
<html>
<head>
<title>asdadsfgaben</title>
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<style type="text/css">
.form > img
@CristianHG2
CristianHG2 / TagsField.vue
Created July 17, 2018 19:35
Vue component with an integration of Selectize.js' tagging feature, reactive to v-model
<template>
<input type="text" class="selectize-tag-input">
</template>
<script>
if (!$().selectize) {
require('selectize') // This script requires selectize
}
export default
{
@CristianHG2
CristianHG2 / drinkinator.php
Created November 1, 2016 01:02
Text based, pseudo-rand based game written in PHP just for fun
<?php
class Player
{
public $health;
public $damage;
public $improve;
public function __construct()
{

Keybase proof

I hereby claim:

  • I am CristianHG2 on github.
  • I am cristianhg (https://keybase.io/cristianhg) on keybase.
  • I have a public key whose fingerprint is BC2F 8945 3B0A EB6D CA06 88BE A93A FBE3 C900 D441

To claim this, I am signing this object: