Skip to content

Instantly share code, notes, and snippets.

View ichensky's full-sized avatar

ichensky

View GitHub Profile
@ichensky
ichensky / Program.cs
Created November 26, 2020 12:30
Example of DDD
using Moq;
using System;
using Xunit;
namespace ConsoleApp2
{
public class User
{
public Guid Id { get; private set; }
@ichensky
ichensky / el
Created December 26, 2018 13:25
public enum Moving {
None,
Down=1,
Up=2
}
public struct State {
public int Elevator;
public int Floor { get; set; }
public Moving Moving { get; set; }
}
https://weblogs.asp.net/ricardoperes/signalr-in-asp-net-core
public class ChatHub : Hub
{
public async Task Send(string message)
{
//await this.Clients.All.InvokeAsync("Send", message);
await this.Clients.Client(this.Context.ConnectionId).InvokeAsync(nameof(Send), message);
}
}
feh --thumbnails --index-info "%n\n%wx%h" *
@ichensky
ichensky / shit.md
Created March 3, 2017 13:59
Why xml and json sucks to s-expressions

For ex. we have struct:

// Keeps info about users account in bank
typedef struct account {
   // account number in bank
   int account_number;
   char *first_name;
   char *last_name;
   // balance in bank 
@ichensky
ichensky / gist:e2e804d740194fe30af8
Created June 30, 2015 22:45
% mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/username
% mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/username
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Category
{
$/
  docs/
  src/
  tests/
  samples/
  artifacts/
  packages/
  build/
 lib/
@ichensky
ichensky / gist:1f185189dc2bd33b811b
Created March 6, 2015 20:23
у тебя есть код, который парсит командную строку в utf-8. Тебе надо под вендой получить командную строку в utf-16 и преобразовать в utf-8, чтобы твой код её корректно прочёл.
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <iconv.h>
#include <string.h>
#define MAX_UTF8_BYTES_PER_CHAR 4
vim + cscope + cgdb