Skip to content

Instantly share code, notes, and snippets.

View devloe's full-sized avatar

Juan Pablo Lozano devloe

View GitHub Profile
@devloe
devloe / gist:182488903a5c2b63d87b
Last active June 4, 2023 17:40
Ejemplo básico de CRUD en Laravel
<?php
// Tenemos un objeto producto en la base de datos
class Product extends Eloquent
{
protected $table = 'products';
}
class BaseController extends Controller{
{
"adminUsers|adminCreateUser|adminEditUser|adminUserProfile": [PermissionProfileEnum.SUPER.value, PermissionProfileEnum.ADMINISTRATOR],
"evaluator": [PermissionProfileEnum.SUPER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSICIAN],
"history": [PermissionProfileEnum.SUPER, PermissionProfileEnum.HCA, PermissionProfileEnum.CASHIER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSICIAN],
"sessionsHistory": [PermissionProfileEnum.SUPER, PermissionProfileEnum.CASHIER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSICIAN],
"patientProfile": [PermissionProfileEnum.SUPER, PermissionProfileEnum.HCA, PermissionProfileEnum.CASHIER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSICIAN],
"patientCreate|patientEdit|patientSearch": [PermissionProfileEnum.SUPER, PermissionProfileEnum.CASHIER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSICIAN],
"patientEditMedicalData": [PermissionProfileEnum.SUPER, PermissionProfileEnum.NURSE, PermissionProfileEnum.PHYSI
alert(1);
@devloe
devloe / demo1.js
Last active November 12, 2019 11:13
var css = `
@import url(../../node_modules/selectize/dist/css/selectize.css);html{height:100%}html [type="radio"]:not(:checked),html [type="radio"]:checked{visibility:hidden}html body{background-color:#f6f6f6;height:100%;color:#6f6f6f;font-family:"Open Sans",sans-serif,sans-serif}html .bg-logo-light{background-image:url(img/logo-light-mediktor.png);background-position:center center;background-repeat:no-repeat}html .bg-logo-dark{background-image:url(img/logo-dark-mediktor.png);background-position:center center;background-repeat:no-repeat}html body.colored{background-color:#0471B9 !important}html .master .bar-bg{height:210px;background:#0471B9 !important;box-shadow:0 1px 10px rgba(0,0,0,0.25)}html .main{margin-top:-210px}html .main-content{margin-top:0;min-height:0}html .main-footer{text-align:center;padding:40px 0;color:#888}html .main-footer img{width:120px;height:auto;vertical-align:middle;margin:0 10px}html hr{border:none;border-top:1px solid rgba(0,0,0,0.1);box-shadow:none !important}html hr.spaced{margin:
const queryParams = "...........&type=ATTACHMENT&filename=" + fileName;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Action to be performed when the document is read;
}
};
<?php
public static function upload($httpRequest, $filedata,$filesize, $filename){
$authToken = Helper::getAuthToken($httpRequest);
$userId = Helper::getUserId($httpRequest);
// if (!is_null($authToken)&&!is_null($userId)){
$method = '?externUserId=' . $userId . '&authToken=' . $authToken .'&type=ATTACHMENT&filename='.$filename;
// } else {
// $method = '/'.$service.'?externUserId='.$request->getDeviceId();
{"swagger":"2.0","info":{"description":"Description","version":"4.0","title":"Mediktor API","contact":{"name":"Mediktor","url":"https://www.mediktor.com","email":"info@mediktor.com"}},"host":"office.mediktor.com","basePath":"/dev","tags":[{"name":"web-service-controller","description":"Web Service Controller"}],"paths":{"/services/agreeLegalTerms":{"post":{"tags":["web-service-controller"],"summary":"agreeLegalTerms","operationId":"agreeLegalTermsUsingPOST","consumes":["application/json"],"produces":["*/*"],"parameters":[{"in":"body","name":"params","description":"params","required":true,"schema":{"$ref":"#/definitions/AgreeLegalTermsRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/GenericResponse"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}},"security":[{"basic":["global"]}]}},"/services/analytics":{"post":{"tags":["web-service-controller"],"summary":"analytics","operationId":"anal
<?php
class CardioRisk {
public static function calculateFemale($age, $cholesterol, $hdl_c, $systolic, $diastolic, $db, $smoker) {
$total_points = 0;
// Edad
if($age > 30 && $age < 34) {
$total_points += -9;
}
Listen 8888
<VirtualHost *:8888>
# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
ssh://jplozano@192.168.1.90/repository/git/mediktor-web-app