Skip to content

Instantly share code, notes, and snippets.

@moreal
moreal / AGREE.md
Created September 20, 2024 14:50 — forked from dahlia/AGREE.md
Nine Corporation Individual Contributor Assignment Agreement

Nine Corporation Individual Contributor Assignment Agreement

Thank you for your interest in contributing to Nine Corporation ("We" or "Us").

This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please follow the instructions at the end. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.

1. Definitions

"You" means the individual who Submits a Contribution to Us.

@moreal
moreal / release-check-script.ps1
Last active September 5, 2022 06:51
"메인넷 업데이트 전 체크리스트" 문서를 따라 체크하는 데 도움을 주는 Powershell 스크립트
$apv=$args[0]
$dict = @{}
Write-Host "1. Try to parse apv"
$result = $(planet.exe apv analyze $apv)
foreach ($item in $result) {
$splitted = $item.Split(" ")
$key = $splitted | Where {!$_.Equals("")} | Select -First 1
$value = $splitted | Where {!$_.Equals("")} | Select -Last 1
$dict[$key] = $value
}
@moreal
moreal / sql-type.ts
Created July 5, 2021 23:51
Simple TypeScript Template Literal Type usage for SQL query
type Split<S extends string, D extends string> = S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
type Strip<S extends string> =
S extends ` ${infer T}`
? Strip<T>
: S extends `${infer U} `
? Strip<U>
: S;
type MapStrip<A extends string[]> =
A extends []
@moreal
moreal / output.txt
Created April 20, 2020 17:34
It is a benchmark to find what fast way when merging two dictionaries, with multiple methods.
$ pytest --benchmark-compare
/Users/moreal/.pyenv/versions/3.7.4/envs/my-ground/lib/python3.7/site-packages/pytest_benchmark/logger.py:44: PytestBenchmarkWarning: Can't compare. No benchmark files in '/private/tmp/test/pytest/.benchmarks'. Can't load the previous benchmark.
warner(PytestBenchmarkWarning(text))
==================================================================================== test session starts ====================================================================================
platform darwin -- Python 3.7.4, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /private/tmp/test/pytest
plugins: benchmark-3.2.3
collected 3 items
from typing import List
import requests
import os
PHPSESSID = os.environ['PHPSESSID']
URL = 'https://webhacking.kr/challenge/web-02/'
def get(condition: str) -> str:
return requests.get(
@moreal
moreal / my-test.cs
Last active September 3, 2019 11:22
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace my_lab
{
class Program
{
class Signaler : IDisposable
@moreal
moreal / dark-magic-to-log-enumerable-all.cs
Created August 14, 2019 07:37
Dark-magic!!! Xunit bye-bye!!!!!!
// Xunit.Sdk.ArgumentFormatter.FormatComplexValue
// to see the real values of expectedStates, actualStates
string FormatComplexValue(object value, Type type)
{
var fields = type.GetRuntimeFields()
.Where(f => f.IsPublic && !f.IsStatic)
.Select(f => new { name = f.Name, value = f.GetValue(value) });
var properties = type.GetRuntimeProperties()
.Where(p => p.GetMethod != null && p.GetMethod.IsPublic)
.Select(p => new { name = p.Name, value = p.GetValue(value) });
X Libplanet.Tests.Net.SwarmTest.GetMultipleBlocksAtOnce [1s 25ms]
Error Message:
System.IO.IOException : The process cannot access the file 'b62c839d-78f4-41b2-8b5a-dfde3cc4fbcd' because it is being used by another process.
Stack Trace:
at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
at Libplanet.Tests.Net.SwarmTest.Dispose() in C:\Users\travis\build\planetarium\libplanet\Libplanet.Tests\Net\SwarmTest.cs:line 81
at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in C:\Dev\xunit\xunit\src\xunit.execution\Extensions\ReflectionAbstractionExtensions.cs:line 79
This file has been truncated, but you can view the full file.
Microsoft (R) Build Engine version 16.0.0.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
/usr/lib/mono/msbuild/15.0/bin/MSBuild.dll -v:diag ./Libplanet.sln
Build started 6/7/2019 4:14:41 PM.
Environment at start of build:
XDG_GREETER_DATA_DIR = /var/lib/lightdm/data/moreal
QT_SCALE_FACTOR = 1.00
XDG_RUNTIME_DIR = /run/user/1000
$ ./StandaloneLinux64 -h
Set current directory to /tmp/xunit-unity-runner
Found path: /tmp/xunit-unity-runner/StandaloneLinux64
Mono path[0] = '/tmp/xunit-unity-runner/StandaloneLinux64_Data/Managed'
Mono config path = '/tmp/xunit-unity-runner/StandaloneLinux64_Data/MonoBleedingEdge/etc'
Initialize engine version: 2019.1.0f2 (292b93d75a2c)
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
Version: NULL 1.0 [1.0]