Skip to content

Instantly share code, notes, and snippets.

View itn3000's full-sized avatar
πŸ€”
πŸ€”πŸ€”πŸ€”πŸ€”πŸ€”πŸ€”

Yusuke Ito itn3000

πŸ€”
πŸ€”πŸ€”πŸ€”πŸ€”πŸ€”πŸ€”
View GitHub Profile
@itn3000
itn3000 / Dockerfile-for-mssql-tools
Last active January 27, 2017 17:13
Dockerfile for sqlserver client tools for linux
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y curl apt-transport-https && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/msprod.list && \
apt-get update && \
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y mssql-tools unixodbc-dev && \
locale-gen en_US en_US.UTF-8 && \
ln -s /opt/mssql-tools/bin/sqlcmd-13.0.1.0 /usr/bin/sqlcmd && \
@itn3000
itn3000 / EventSourceListener.cs
Created February 2, 2017 12:21
example EventSource and EventListener
using System;
using System.Diagnostics.Tracing;
using System.Diagnostics;
class Program
{
class MyEventListener : EventListener
{
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
@itn3000
itn3000 / RustlikeResult.cs
Last active February 2, 2018 06:16
Result type like rust's std::result::Result<T, E>
using System;
using System.Threading.Tasks;
namespace optionalresulttest
{
public static class Result
{
public static Result<T> From<T>(Func<T> generateFunc)
{
try
{
@itn3000
itn3000 / Dockerfile-for-build-gitfs
Last active April 20, 2017 04:55
build gitfs docker file and patch for xenial
FROM ubuntu:xenial
# if you need to http proxy
# ENV http_proxy=http://proxy:8080
# ENV https_proxy=http://proxy:8080
RUN apt-get update && \
apt-get install -y \
build-essential \
libffi-dev \
  • a
    • b
  • c
    1. A
    2. B
  1. d
    • C
  2. e
  • D
@itn3000
itn3000 / StanTest.cs
Created May 17, 2017 04:05
nats-streaming subscribe test
namespace StanTest
{
using System;
using STAN.Client;
using System.Threading.Tasks;
using System.Threading;
using System.Text;
static class Tests
{
public static async Task CreateProducerTask(StanConnectionFactory cf, StanOptions opts)
@itn3000
itn3000 / natstest.cs
Created May 20, 2017 16:53
nats bench sources
using System;
using NATS.Client;
namespace natstest
{
class Program
{
static void i32tobytes(int val, ref byte[] buf)
{
buf[0] = (byte)(val & 0xff);
@itn3000
itn3000 / ArrayPoolTest.cs
Last active May 23, 2017 02:00
ArrayPool.Rent vs new byte[] test(netcoreapp2.0-preview1)
using System;
using System.Buffers;
namespace bufferpooltest
{
class Program
{
const int LoopCount = 100000000;
static void ArrayPoolTest(int loopCount, int bufferSize)
{
@itn3000
itn3000 / ValueArraySegment.cs
Last active May 23, 2017 06:44
implementation of ValueArraySegment
namespace bufferpooltest
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Stopwatch = System.Diagnostics.Stopwatch;
static class TestValueArray
{
const int LoopCount = 100000000;
@itn3000
itn3000 / NetMqPubsubTest.cs
Last active May 26, 2017 07:00
tests of netmq
using System;
namespace netmqtest
{
using NetMQ;
using NetMQ.Sockets;
using System.Threading.Tasks;
using System.Threading;
using System.Linq;
class Program