Skip to content

Instantly share code, notes, and snippets.

View niku's full-sized avatar
💭
🍖

KITAMURA Daisuke niku

💭
🍖
View GitHub Profile
@niku
niku / .README.md
Last active February 17, 2024 20:48
a sample repository of prop_check with test-unit

This repository is working sample of prop_check with test-unit.

$ ruby run_test.rb
Loaded suite 6dec8e397943cdc372b969fff26299e7
Started
E
================================================================================================================================================
Error: test_that_it_returns_an_integer_for_any_input(TestNaiveAverage):
 ZeroDivisionError:
@niku
niku / .gitignore
Last active December 23, 2023 12:19
a sample repository of prop_check with rspec
#
@niku
niku / go.mod
Last active December 21, 2021 14:04
Make buckets has no object even if the bucket is versioning-enabled
module niku/cleanup-version-enabled-bucket
go 1.17
require (
github.com/aws/aws-sdk-go-v2 v1.11.2
github.com/aws/aws-sdk-go-v2/config v1.11.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.21.0
)
# 比較用
# https://elixir-lang.org/getting-started/mix-otp/task-and-gen-tcp.html
defmodule KVServer do
require Logger
@doc """
Starts accepting connections on the given `port`.
"""
def accept(port) do
{:ok, socket} = :gen_tcp.listen(port,
{
"make equality properly": {
"prefix": "eq",
"body": [
"@override",
"bool operator ==(Object other) =>",
" identical(this, other) ||",
" other is $1 &&",
" runtimeType == other.runtimeType${2/ ([^ ]+)/ && ${1} == other.${1}/g};",
"",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@niku
niku / instructions.md
Last active January 21, 2020 04:28
How to get a runtime_info as a file
❯ iex
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Interactive Elixir (1.10.0-rc.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> file = File.open!("./runtime_info.txt", [:write])
#PID<0.110.0>
iex(2)> original_group_leader = Process.group_leader()
#PID<0.64.0>
iex(3)> Process.group_leader(self(), file)
/tmp $ git clone https://github.com/msantos/procket.git
/tmp $ cd procket/
/tmp/procket $ rebar3 compile
# The compile should be succeed
## Add new module
/tmp/procket $ echo '-module(hello).
-export([hello_world/0]).
hello_world() -> io:fwrite("hello, world\n").' > src/hello.erl
@niku
niku / index.md
Last active November 11, 2019 09:12
ふつうのプログラマたちはいいチームを作り維持することができるか

ふつうのプログラマたちはいいチームを作り維持することができるか

私たちをとりまいていた状況

組織

@niku
niku / slide.org
Last active June 1, 2019 05:00
Slide for Erlang & Elixir Fest 2019 -- https://elixir-fest.jp/

Protocol Buffers implementation with using Elixir

Agenda

  • How to parse a binary 00001000_10010110_00000001 to %{1 => 150}