Skip to content

Instantly share code, notes, and snippets.

View KEINOS's full-sized avatar

KEINOS KEINOS

View GitHub Profile
@KEINOS
KEINOS / README.md
Last active May 28, 2023 08:44
Identity file for Gistargazer, the badge service for number of stars in a gist. See: https://github.com/KEINOS/gistargazer

Example repo for Gistargazer API

This gist repository is an example of a Gistargazer API ID file deployment.

Notes

  • The only file required is "gistargazer.json", the others are ignored.
  • The gist ID (in this case "42f5f23053ab59ca480f480b8d01e1fd") is the Gistargazer API user ID.
  • After submitting the ID file "gistargazer.json" to the gist repository with "allow_badge" element as "yes", go to the following URL and check that the file appears:
  • https://gist.githubusercontent.com///raw/gistargazer.json
@KEINOS
KEINOS / MBP.md
Created May 14, 2023 23:45
[Memo] KEINOS' Hardware Information

Hardware information to prepare for Linux migration before Apple support ends.

$ date -R
Mon, 15 May 2023 08:41:18 +0900

$ sw_vers
ProductName:	macOS
ProductVersion:	12.6.5
BuildVersion:	21G531
@KEINOS
KEINOS / 20230512-1430.md
Created May 12, 2023 05:32
[Sample Post]
title Hoge
description sample post
publishDate 2023-01-11 23:13:22 +0900
draft false
tags
sample

Hoge Hoge

@KEINOS
KEINOS / uint64_to_bytes.md
Created May 1, 2023 07:31
[Golang] Converting uint64 to byte slices.

Converting uint64 to []byte in Go

tl; dr

Using LittleEndian.PutUint64 function from encoding/binary package is much faster than bit shifting.

0.3468n/op vs 3.905n/op

import "encoding/binary"
@KEINOS
KEINOS / openpgp.md
Created April 22, 2023 00:43
[Keyoxide] Identity Proof for Keyoxide

openpgp4fpr:4FDD93EDA91BA3AD071ED4118B888AD8EDD27C2D

@KEINOS
KEINOS / README.md
Created April 20, 2023 02:28
[Golang] Example of Fletcher16 implementation in Go.

Example of Fletcher16 (Fletcher's checksum) in Go

package main

import "fmt"

// Fletcher16 returns the checksum of the data using the Fletcher's
// checksum algorithm.
func Fletcher16(data []byte) uint16 {
@KEINOS
KEINOS / README.md
Last active March 2, 2024 18:05
[Golang]: Simple example of Diffie–Hellman key exchange

ディフィー・ヘルマン鍵共有の概念 with Go

package main

import "fmt"

// Public constant
const (
	g = 2 // 基数
@KEINOS
KEINOS / gist_comment.md
Last active March 12, 2023 12:54
[GitHub API v4] GraphQL API Example to retrieve/get comments in Gist.

GitHub GraphQL API (GitHub API v4) example to retrieve/get comments in Gist.

{
  viewer {
    gist(name: "78cc23f37e55e848905fc4224483763d") {
      comments(last: 100) {
        edges {
          node {
 author {
@KEINOS
KEINOS / README.md
Last active March 9, 2023 10:21
[Docker] [Alpine] 5 things you should try if the container fails to boot

5 things you should try if the container fails to boot

  1. Reboot the service.

    sudo systemctl restart docker.service
  2. Try "hello-world".

@KEINOS
KEINOS / README.md
Last active February 9, 2023 02:51
JSON file of Joyo kanjis(常用漢字) to facilitate the search for Japanese kanji readings.

Jōyō Kanjis 2010(常用漢字読み仮名)

In this gist we provide 2 JSON files.