Skip to content

Instantly share code, notes, and snippets.

View sakisk's full-sized avatar
🏠
Working from home

Sakis Koltsidas sakisk

🏠
Working from home
View GitHub Profile
@sakisk
sakisk / ohmyposhv3-v2.json
Created November 22, 2021 20:09 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@sakisk
sakisk / SystemDateTime.cs
Created March 11, 2020 11:49
SystemDateTime
public static class SystemDateTime
{
private static readonly Func<DateTime> DefaultUtcNow = () => DateTime.UtcNow;
private static Func<DateTime> _func = DefaultUtcNow;
public static DateTime UtcNow => _func();
public static void Set(DateTime now) => _func = () => now;

Keybase proof

I hereby claim:

  • I am sakisk on github.
  • I am sakisk (https://keybase.io/sakisk) on keybase.
  • I have a public key ASAox08JjWffv0Z5IipGxTaHsPupmBVfcSv9ypzi1Wch-wo

To claim this, I am signing this object:

@sakisk
sakisk / gist:07d450254fe9f5ab3395
Last active September 1, 2015 15:31
Get datetime 8 months before now in Nodatime
using NodaTime;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Get now from system clock (this is an Instant)
var now = SystemClock.Instance.Now;
public static class RandomHelper
{
private static int _seedCounter = new Random().Next();
[ThreadStatic]
private static Random _rng;
public static Random Instance
{
get