Skip to content

Instantly share code, notes, and snippets.

View Midoliy.Office.Interop.Excel.Extensions.cs
using System;
static void Test(string columnName) => Console.WriteLine("{0,-3} => {1,4} => {2,-3}", columnName, columnName.ToColumnNumber(), columnName.ToColumnNumber().ToColumnName());
Test("A");
Test("Z");
Test("AA");
Test("ZZ");
Test("AAA");
Test("BBB");
@sayurin
sayurin / Dockerfile
Created Nov 12, 2019
vsFTPd + OpenSSLの組み合わせ確認
View Dockerfile
ARG centos=latest
FROM centos:$centos
RUN yum install -x openssl -x openssl-libs -y gcc libcap-devel perl \
&& rm -rf /var/cache/yum/* \
&& useradd -m guest \
&& echo 'guest:guest' | chpasswd
WORKDIR /root/openssl
ARG openssl=https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz
RUN curl $openssl | tar xfz - --strip=1 \
&& ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \
View zlib.fs
namespace Sayuri.IO.Compression
open System.IO
open System.IO.Compression
module ZLib =
[<Literal>]
let private ModuloAdler = 65521u
let private adler32 (buffer : byte[]) =
let mutable a = 1u
let mutable b = 0u
View zlib.fs
#nowarn "9"
namespace Sayuri.IO.Compression
open System.IO.Compression
open System.Reflection
type ZLibOption = {
CompressionLevel : int // -1, 0 .. 9
WindowBits : int // (8), 9 .. 15
MemLevel : int // 1 .. 9
CompressionStrategy : int // 0, 1 .. 4
@sayurin
sayurin / twitterclient.cpp
Created May 23, 2019
Sample Twitter client using C++ REST SDK.
View twitterclient.cpp
#include <locale>
#include <cpprest/http_client.h>
#include <cpprest/oauth1.h>
static constexpr auto
apikey = U(""),
apisecretkey = U(""),
accesstoken = U(""),
accesstokensecret = U("");
@sayurin
sayurin / a.cs
Created Apr 11, 2019 — forked from yuka1984/a.cs
わかんないやつ
View a.cs
public interface EntityBase {
string Name { get; }
}
public abstract class RepositoryBase<T> where T : EntityBase, new() {
private readonly string _name;
public RepositoryBase() {
_name = new T().Name;
}
@sayurin
sayurin / hfs+.cpp
Last active Mar 15, 2019
HFS+に出現しない文字、出現する文字
View hfs+.cpp
#include <charconv>
#include <fstream>
#include <iostream>
#include <map>
#include <regex>
#include <set>
#include <string>
#include <string_view>
#include <cassert>
using namespace std::literals;
View date-format.ps1
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\> Get-Date; -join (Get-Date); -join ,(Get-Date)
201892716:13:06
09/27/2018 16:13:06
2018/09/27 16:13:06
View vtable.cpp
struct Base {
virtual ~Base() = default; // ... A
~Base() = default; // ... B
};
struct Derived : Base {
~Derived() = default; // ... a
virtual ~Derived() = default; // ... b
~Derived() override = default; // ... c
};
View ProtocolCombination.cpp
#define SECURITY_WIN32
#include <iostream>
#include <tuple>
#include <Windows.h>
#include <security.h>
#include <schannel.h>
#pragma comment(lib, "Secur32.lib")
static std::tuple<int, const char*> protocols[] = {
{ SP_PROT_PCT1_CLIENT, "PCT 1.0" },