Skip to content

Instantly share code, notes, and snippets.

@stevenguh
stevenguh / ConfigureForNodaTimeBenchmarks.cs
Created August 24, 2017 18:07
Benchmarks for nodatime.serialization #12 (TypeDescriptor vs ConfigureForNodaTime)
[MemoryDiagnoser]
public class ConfigureForNodaTimeBenchmarks
{
static readonly Instant _instant = Instant.FromUtc(2017, 6, 7, 0, 0);
static readonly DateTime _dateTime = new DateTime(2017, 6, 7);
static readonly JsonSerializerSettings _settings = new JsonSerializerSettings();
static ConfigureForNodaTimeBenchmarks()
{
_settings.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
@stevenguh
stevenguh / NodaContractResolverBenchmarks.cs
Created August 31, 2017 19:22
NodaContractResolverBenchmarks
using System;
using BenchmarkDotNet.Attributes;
using Newtonsoft.Json;
using NodaTime.Serialization.JsonNet;
namespace NodaTime.Serialization.Benchmarks.JsonNet
{
[MemoryDiagnoser]
public class NodaContractResolverBenchmarks
{
@stevenguh
stevenguh / tcn.py
Created February 7, 2019 05:49
Temporal Conv Net with Non-Causal Conv in PyTorch
# Import TCN library from https://github.com/locuslab/TCN
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import weight_norm
def conv1d_same_padding(input, weight, bias=None, stride=1, dilation=1, groups=1):
input_length = input.size(2)
filter_length = weight.size(2)
@stevenguh
stevenguh / .tmux.conf
Last active November 16, 2021 01:54
My zsh settings
# The best and greatest tmux.conf ever - improved!
# https://gist.github.com/rsp/f4770a1fe8ea7e2378ac3a16e01a2b53
# Here are some customizations done by Rafał Pocztarski:
# use Ctrl+Backslash instead of Ctrl+A or Ctrl+B
# use Slash to split vertically
# use Backslash to split horizontally
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix