Skip to content

Instantly share code, notes, and snippets.

FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /app
COPY . .
RUN dotnet restore
WORKDIR /app/Latihan.Web
RUN dotnet publish -c Release -o out
FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime
@gsedubun
gsedubun / CRUDWPF.packages.config
Created August 24, 2018 03:45
packages config untu WPF CRUD
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net462" />
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
<package id="Prism.Core" version="6.3.0" targetFramework="net462" />
<package id="Prism.Unity" version="6.3.0" targetFramework="net462" />
<package id="Prism.Wpf" version="6.3.0" targetFramework="net462" />
<package id="SQLite.CodeFirst" version="1.5.1.25" targetFramework="net462" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net462" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net462" />
using Microsoft.AspNetCore.Mvc;
using tracking.Models;
namespace tracking.Controllers
{
public class MapController : Controller{
private AirportRepository Repository;
public MapController(AirportRepository airport)
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
@{
ViewData["Title"] = "Map";
}
<h2>@ViewData["Title"]</h2>
@section HeadScripts{
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css"
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js"
using System.Collections.Generic;
using System.Data.SqlClient;
using Dapper;
namespace tracking.Models
{
public class AirportRepository{
// change the user id and password accordingly.
private const string connstring = "Data Source=.\\sqlexpress;Initial Catalog=OSM_DB;user id=[id]; password=[password]";
private SqlConnection Connection;
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
///
/// sesuai bawaan template project
///
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, d =>
@{
ViewData["Title"] = "Chat";
}
<h2>Chat</h2>
<div class="container">
<form id="send-form" action="#">
<div class="form-group">
<label>Send a message:</label>
<div class="input-group">
@gsedubun
gsedubun / ChatHub.cs
Last active June 26, 2018 14:58
simple SignalR chat hub
public class ChatHub : Hub
{
public void Send(string message)
{
Clients.All.SendAsync("SendMessage", Context.User.Identity.Name, message);
}
public override async Task OnConnectedAsync(){
await Clients.All.SendAsync("SendAction", Context.User.Identity.Name, "joined");
}
@gsedubun
gsedubun / ViewA.xaml
Last active May 22, 2018 03:51
ViewA.xaml is a view to display the announcement list and details of the selected announcement.
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*" MaxHeight="200" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
<RowDefinition Height="2*" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"/>
</Grid.RowDefinitions>