This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const addConditions = async ({ request, response} | |
: {request: any, response:any}) =>{ | |
const body = await request.body(); | |
if (!request.hasBody) { | |
response.status = 400 | |
response.body = { | |
success: false, | |
message: 'KO' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Application } from 'https://deno.land/x/oak/mod.ts' | |
import { oakCors } from 'https://deno.land/x/cors/mod.ts'; | |
import router from './routes.ts' | |
const HOST = '127.0.0.1' | |
const PORT = 7700 | |
const app = new Application() | |
app.use(oakCors()); // Enable CORS for All RoutesS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const addConditions = async (context: any) => { | |
const formData = await context.request.body() as IReceivedConditions; | |
formMealsMenu(formData); | |
context.response.body = { message: 'OK' }; | |
context.response.status = 200; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a [routerLink]="['/mipaginaconAnchor']" fragmente="tuId"> Ir a mi anchor </a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NgModule({ | |
imports: [ | |
RouterModule.forRoot(routes, { | |
onSameUrlNavigation: "ignore", | |
anchorScrolling:'enabled', | |
scrollPositionRestoration: 'enabled' | |
}) | |
], | |
exports: [RouterModule] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Functor | |
var a = List[Int]@{...} | |
var b = a.map[Int]( fn(x)=>(x+2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(@[7, 8]) <~ (0=5, 3=1); //@[5, 8, none, 1] | |
(@[7, 8] <+ (@[5]); // @[7, 8, 5] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concept Bar{ | |
... | |
field k: Bool; | |
} | |
var x=Baz@{f=1, g=2, k=true}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string? fullname = person switch | |
{ | |
null => null, | |
(null, string lastname) => $"Señor/a {lastname}", | |
(string firstname, string lastname)=> $"{firstname} {lastname}" | |
} |