Skip to content

Instantly share code, notes, and snippets.

View Santiago-j-s's full-sized avatar

Santiago Santana Santiago-j-s

View GitHub Profile
<?php
namespace backend\models\charts;
use common\models\ChecklistLineInstance;
use Yii;
use yii\db\Query;
function queryLines(): Query
{
app.post("/login", (req, res) => {
let body = req.body
Usuario.findOne({user: body.user}, (error, userDB) =>{
if(error){
res.status(400);
res.render('error.hbs', { error: error })
}
# https://github.com/hardcoreplayers/dotfiles/blob/master/tmux/.tmux.conf
# battery colors
set -g @batt_color_charge_secondary_tier8 'colour0'
set -g @batt_color_charge_secondary_tier7 'colour0'
set -g @batt_color_charge_secondary_tier6 'colour0'
set -g @batt_color_charge_secondary_tier5 'colour0'
set -g @batt_color_charge_secondary_tier4 'colour15'
set -g @batt_color_charge_secondary_tier3 'colour15'
set -g @batt_color_charge_secondary_tier2 'colour15'
@Santiago-j-s
Santiago-j-s / request.json
Last active June 29, 2020 13:15
Example POST request with base64 data
{
"description": "description-test",
"photo": "iVBORw0KGgoAAAANSUhEUgAAAxQAAAKDCAYAAACDl0zeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAPHXSURBVHhe7P0HfBx5fh54P51zo7vRyBkEwJyGcfLszIbZnLS72tUqWDq9r2zJtny2pdNZd5Z9/tgnvZbPWp9tfRRs5V1tTpMzOUMOOcwBBBGInLrROef39y80OBiGWU4vh0Ngnu9uDYHqylWN/j1d9a/SheKZCoiIiIiIiGqgr/5LRERERET0jjFQEBERERFRzRgoiIiIiIioZgwURERERERUMwYKIiIiIiKqGQMFERERERHVjIGCiIiIiIhqxkBBREREREQ1Y6AgIiIiIqKaMVAQEREREVHNGCiIiIiIiKhmDBRERERERFQzBgoiIiIiIqoZAwUREREREdWMgYKIiIiIiGrGQEFERERERDXTheKZSvXnd6RSeXO01T8TEREREdH7xy0HipXQcKN/VzoiIiIiIlr/dDpd9adbCBQ3Cg5qdJ1ep01I+1kbQoaR/xERERER0fq1nACWqfr/lgJFuVy++rNilDBhMBigl3+1rhosqtFD+y8REREREa0/K4FChYmylP43DRQr4WF1oFBnNox6PcxmI4wGvQQJ6fRYDhSrTnsQEREREdH6puUE6W4YKK4NE5VKWQKEASajAVazSfuX+YGIiIiIiK67bexKmFBBYiVMmAxGLUjYLCpM6BkmiIiIiIhIc8PnUKhQsdIZ1CVOJoPWGQwqTDBNEBERERHRsrcNFDpUtMubVsKEaitBRERERES04i2BYiVIaI2wVaCQAGHVLnMyMEwQEREREdF1rjtDsXJHJ3U7WJPJCLPRyMuciIiIiIjohm56yZNetZ3g3ZyIiIiIiOhtXBcoVJiQ/2pBQt0qloiIiIiI6GauBoqV9hPLnXoCngoUPD1BR
@Santiago-j-s
Santiago-j-s / machine.js
Last active May 5, 2020 19:59
Generated by XState Viz: https://xstate.js.org/viz
const DIAS_CRITICIDAD_MEDIA = 30;
const DIAS_CRITICIDAD_ALTA = 15;
const DIAS_VENCIDO = 0;
const isProximoAVencer = (context) => context.dias ? context.dias <= DIAS_CRITICIDAD_ALTA : false;
const isVencido = (context) => (context.dias !== undefined) ? context.dias <= 0 : false;
const isCriticidadMedia = (context) => context.dias ? context.dias <= DIAS_CRITICIDAD_MEDIA : false;
const checklistMachine = {
id: "checklist",
No overload matches this call.
Overload 1 of 2, '(config: MachineConfig<any, any, AnyEventObject>, options?: Partial<MachineOptions<any, AnyEventObject>> | undefined, initialContext?: any): StateMachine<...>', gave the following error.
Type '{ id: string; states: StateNodesConfig<any, any, AnyEventObject>; config: StateNodeConfig<any, any, AnyEventObject>; ... 20 more ...; __xstatenode: true; }' is not assignable to type 'StateNodeConfig<any, any, AnyEventObject>'.
Types of property 'states' are incompatible.
Type 'StateNodesConfig<any, any, AnyEventObject>' is not assignable to type 'StatesConfig<any, any, AnyEventObject>'.
Index signatures are incompatible.
Type 'StateNode<any, any, AnyEventObject, any>' is not assignable to type 'StateNodeConfig<any, any, AnyEventObject>'.
Types of property 'after' are incompatible.
Type 'DelayedTransitionDefinition<any, AnyEventObject>[]' is not assignable to type 'Record<string | number, string | Tra
@Santiago-j-s
Santiago-j-s / machine.js
Last active April 27, 2020 20:08
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
% Ejercicio 1a
% Comprobar si una lista de elementos constituye un conjunto válido
% Un conjunto es una lista de elementos que no contiene elementos repetidos
% pertenece(Lista, Elemento): true si Elemento esta en Lista
pertenece([], _) :- fail.
pertenece([E|_], E) :- !.
pertenece([_|L], E) :- pertenece(L, E).
% esConjunto(Lista): true si Lista es un conjunto
@Santiago-j-s
Santiago-j-s / profiles.json
Last active January 19, 2020 04:30
terminal config
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles": [
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
@Santiago-j-s
Santiago-j-s / machine.js
Last active December 19, 2019 19:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions