Skip to content

Instantly share code, notes, and snippets.

View azaharafernandezguizan's full-sized avatar

Azahara Fernández Guizán azaharafernandezguizan

View GitHub Profile
@azaharafernandezguizan
azaharafernandezguizan / IInfoManager.cs
Created December 30, 2018 17:12
Example of manager interface on NetCore
using MyDBContext.Models;
using MyDTOs;
using System;
using System.Collections.Generic;
using System.Text;
namespace MyManager
{
public interface IInfoManager
{
@azaharafernandezguizan
azaharafernandezguizan / InfoController.cs
Created December 30, 2018 17:15
Example of Web API Controller on NetCore
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MyDTOs;
using MyManager;
using Microsoft.AspNetCore.Mvc;
namespace MyApp.Controllers
{
string? fullname = person switch
{
null => null,
(null, string lastname) => $"Señor/a {lastname}",
(string firstname, string lastname)=> $"{firstname} {lastname}"
}
@azaharafernandezguizan
azaharafernandezguizan / constructor.ts
Created September 7, 2019 16:11
Bosque Language object creation example
concept Bar{
...
field k: Bool;
}
var x=Baz@{f=1, g=2, k=true};
@azaharafernandezguizan
azaharafernandezguizan / bulkalgebraic.ts
Created September 7, 2019 16:16
Bulk algebraic data operations in Bosque Language
(@[7, 8]) <~ (0=5, 3=1); //@[5, 8, none, 1]
(@[7, 8] <+ (@[5]); // @[7, 8, 5]
@azaharafernandezguizan
azaharafernandezguizan / functor.ts
Created September 7, 2019 16:19
Example of functor Bosque Language
//Functor
var a = List[Int]@{...}
var b = a.map[Int]( fn(x)=>(x+2);
@azaharafernandezguizan
azaharafernandezguizan / helloWorldGPIO.js
Last active September 9, 2019 10:10
Example of hello World on GPIO
var Gpio = require('onoff').Gpio;
var LED = new Gpio(18, 'out’);
var ledInterval = setInterval(sayHello, 300);
function sayHello () {
if (LED.readSync() === 0) {
LED.writeSync(1); //se enciende
} else {
LED.writeSync(0); //se apaga
@azaharafernandezguizan
azaharafernandezguizan / app-routing.module.ts
Created September 19, 2019 15:08
Routing module with anchor scrolling
@NgModule({
imports: [
RouterModule.forRoot(routes, {
onSameUrlNavigation: "ignore",
anchorScrolling:'enabled',
scrollPositionRestoration: 'enabled'
})
],
exports: [RouterModule]
})
@azaharafernandezguizan
azaharafernandezguizan / pageCalling.component.html
Created September 19, 2019 15:11
Call to anchor in Angular
<a [routerLink]="['/mipaginaconAnchor']" fragmente="tuId"> Ir a mi anchor </a>
@azaharafernandezguizan
azaharafernandezguizan / notWorkingDenoPost.ts
Created August 3, 2020 13:19
Post in Deno not working correctly
const addConditions = async (context: any) => {
const formData = await context.request.body() as IReceivedConditions;
formMealsMenu(formData);
context.response.body = { message: 'OK' };
context.response.status = 200;
}