Skip to content

Instantly share code, notes, and snippets.

View bpesquet's full-sized avatar

Baptiste Pesquet bpesquet

View GitHub Profile
const rootEndpoint = "https://www.thecocktaildb.com/api/json/v1/1";
// Model class for a cocktail
export class Cocktail {
constructor(id, name, image, instructions) {
this.id = id;
this.name = name;
this.image = image;
this.thumbnail = image + "/preview";
this.instructions = instructions;
using MvcUniversity.Data;
namespace MvcUniversity.Models;
public class SeedData
{
public static void Init()
{
using (var context = new UniversityContext())
{
// Add students
Student carson = new Student
{
FirstName = "Alexander",
LastName = "Carson",
EnrollmentDate = DateTime.Parse("2016-09-01"),
};
Student alonso = new Student
{
FirstName = "Meredith",
@model MvcUniversity.Models.Instructor
@{
ViewData["Title"] = "Edit";
}
<h1>Edit</h1>
<h4>Instructor</h4>
<hr />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MvcUniversity.Data;
using MvcUniversity.Models;
namespace MvcUniversity.Controllers
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using MvcUniversity.Models;
namespace MvcUniversity.Data
{
public static class SeedData
using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using MvcUniversity.Models;
namespace MvcUniversity.Data
{
public static class SeedData
{
@bpesquet
bpesquet / todo.service.ts
Created March 1, 2021 17:41
Async storage of todos
import AsyncStorage from "@react-native-async-storage/async-storage";
export interface Todo {
task: string;
completed: boolean;
}
class TodoService {
// Return all todos asynchronously. Returns a Promise
async getAll(): Promise<Array<Todo>> {
export interface Todo {
task: string;
completed: boolean;
}
class TodoService {
private todos: Array<Todo> = [];
// Return all todos asynchronously. Returns a Promise
getAll(): Promise<Array<Todo>> {
Bitmap bmp;
Random rd = new Random();
double xc1 = 200;
double yc1 = 200;
double rayon1 = 150;
double sigma1 = 5.0;
double xc2 = 350;
double yc2 = 220;
double rayon2 = 150;