Skip to content

Instantly share code, notes, and snippets.

View sayurin's full-sized avatar

Kurata Sayuri sayurin

  • Japan
  • 19:49 (UTC +09:00)
View GitHub Profile
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 November 12, 2019 14:01
vsFTPd + OpenSSLの組み合わせ確認
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 \
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
#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 21:45
Sample Twitter client using C++ REST SDK.
#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 April 11, 2019 23:23 — forked from yuka1984/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 September 21, 2022 07:57
HFS+に出現しない文字、出現する文字
#include <charconv>
#include <fstream>
#include <iostream>
#include <map>
#include <regex>
#include <set>
#include <string>
#include <string_view>
#include <cassert>
using namespace std::literals;
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
struct Base {
virtual ~Base() = default; // ... A
~Base() = default; // ... B
};
struct Derived : Base {
~Derived() = default; // ... a
virtual ~Derived() = default; // ... b
~Derived() override = default; // ... c
};
#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" },