Skip to content

Instantly share code, notes, and snippets.

@vkocjancic
vkocjancic / MyObject.cs
Created Jan 21, 2020
.NET Reflection issue
View MyObject.cs
internal class MyObject
{
#region Properties
#region PropNumericA
private int _propNumericA;
private bool _fPropNumericA;
@vkocjancic
vkocjancic / CryptowatchData.scala
Created Apr 12, 2019
A way to get OHLC data from Cryptowatch API in scala
View CryptowatchData.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 Jan 10, 2019
A simple sample for async write to file in C++
View Async write to file C++ - sample
#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 Sep 26, 2016
Non-whitespace sample for Bart Sokol's F# blog
View sample.cs
Product GetProductById(int id)
{
return (id > 0) ? _productRepository.Get(id) : null;
}
@vkocjancic
vkocjancic / Fingerprint.cs
Last active Aug 29, 2015
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)
View Fingerprint.cs
using System.IO;
using System.Web;
using System.Web.Caching;
using System.Web.Hosting;
public static class Fingerprint
{
public static string Tag(string rootRelativePath)
{