Skip to content

Instantly share code, notes, and snippets.

@vkocjancic
vkocjancic / MyObject.cs
Created January 21, 2020 21:28
.NET Reflection issue
internal class MyObject
{
#region Properties
#region PropNumericA
private int _propNumericA;
private bool _fPropNumericA;
@vkocjancic
vkocjancic / CryptowatchData.scala
Created April 12, 2019 04:47
A way to get OHLC data from Cryptowatch API in scala
import org.json4s._
import org.json4s.native.JsonMethods._
case class MarketCandle(
unixCloseTime: Int,
openPrice: Double,
highPrice: Double,
lowPrice: Double,
closePrice: Double,
change: Double,
@vkocjancic
vkocjancic / Async write to file C++ - sample
Last active January 10, 2019 22:08
A simple sample for async write to file in C++
#include "pch.h"
#include <iostream>
#include <Windows.h>
#include <atlstr.h>
VOID WINAPI FileWrittenCallback(DWORD dwErrorCode, DWORD dwBytesTransferred, LPOVERLAPPED lpOverlapped) {
if (dwErrorCode != 0) {
fprintf(stdout, "CompletionRoutine: Unable to write to file! Error: %u, AddrOverlapped: %p\n", dwErrorCode, lpOverlapped);
}
@vkocjancic
vkocjancic / sample.cs
Created September 26, 2016 15:31
Non-whitespace sample for Bart Sokol's F# blog
Product GetProductById(int id)
{
return (id > 0) ? _productRepository.Get(id) : null;
}
@vkocjancic
vkocjancic / Fingerprint.cs
Last active August 29, 2015 14:27
A fingerprint class for versioning of static web content (derives from Mads Kristensen's Fingerprint class found here http://madskristensen.net/post/cache-busting-in-aspnet)
using System.IO;
using System.Web;
using System.Web.Caching;
using System.Web.Hosting;
public static class Fingerprint
{
public static string Tag(string rootRelativePath)
{