Skip to content

Instantly share code, notes, and snippets.

View tomasherceg's full-sized avatar
🌈

Tomáš Herceg tomasherceg

🌈
  • CEO of RIGANTI, co-author of DotVVM, Microsoft MVP (Visual Studio and Developer Technologies)
  • Prague, Czech Republic
View GitHub Profile
@tomasherceg
tomasherceg / gist:7869699
Created December 9, 2013 09:35
Kurz ASP.NET Web API - třída ProductsController
public class ProductsController : ApiController
{
private static Dictionary<int, Product> products = new Dictionary<int, Product>();
static ProductsController()
{
products.Add(1, new Product() { Name = "Rohlík", Category = "Jídlo", UnitsOnStock = 100 });
products.Add(2, new Product() { Name = "Hrábě", Category = "Nářadí", UnitsOnStock = 5 });
products.Add(3, new Product() { Name = "Coca Cola", Category = "Nápoje", UnitsOnStock = 10 });
@tomasherceg
tomasherceg / Article.cs
Last active June 3, 2016 13:08
Vzorová databáze pro kurz IoC/DI
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Riganti.Utils.Infrastructure.Core;
namespace Blog.DAL
{
public class Article : IEntity<int>
{
public int Id { get; set; }
@tomasherceg
tomasherceg / App.xaml
Last active June 16, 2016 09:05
Kurz Xamarin Forms
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ChatApp.Client.App">
<Application.Resources>
<!-- Application resource dictionary -->
</Application.Resources>
</Application>
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace EchoServer
{
class Program
{
static void Main(string[] args)
@tomasherceg
tomasherceg / mfftest.ppk
Created April 5, 2017 15:30
SSH test public key
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20170405
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABJQAAAQEAh1VjMlI0g7nvYMoYX3ZmF5jLfXF8jMOfPnhX
29ehMu48I/snuvomy/OSBPaomPfIgKgaVwrWbZL1XjOcwRm6+0zLkze7vtMgUePj
0RwfkJudR3eTQBueRL1PFIT41Vmtze1rWVpOk8NAypT7R2F0YTSBLw71TypEq3En
ijvQTSlcVvmWG8fd0OmEPLxlDJl7UWVbCBPThko7Bf4dopB2O9y4ZlJBbl8YAgL6
H5yhYPPPwrIOdP8NWa3tcW+y/JwROw6DIEFE6ZdzCo3E23llKFTCRUwpEnHBgog0
FqLdl1ow2rn6Oerh66L+7hb+bBgL15LLiWZqx+wu0RaDnkGJdw==
@tomasherceg
tomasherceg / Default.dothtml
Created July 6, 2020 09:16
Proposal of DotVVM & JS modules usage
@viewModel DotvvmLovesJsSample.ViewModels.DefaultViewModel, DotvvmLovesJsSample
@jsModule Scripts/map
<h1>Map Demo</h1>
<div id="map"></div>
<form>
<div>Latitude: <dot:TextBox Text="{value: Lat} /></div>
<div>Longitude: <dot:TextBox Text="{value: Lng} /></div>
@tomasherceg
tomasherceg / input.txt
Created July 2, 2023 10:00
CSharp-Training
TSLA;302
TSLA;913
META;892
GOOG;212
TSLA;427
TSLA;624
AMZN;89
NVDA;246
MSFT;671