Skip to content

Instantly share code, notes, and snippets.

View DQNEO's full-sized avatar

Daisuke Kashiwagi DQNEO

View GitHub Profile
@DQNEO
DQNEO / COPYING
Last active November 21, 2023 16:51
git index parser by C
Note that the only valid version of the GPL as far as this project
is concerned is _this_ particular version of the license (ie v2, not
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
HOWEVER, in order to allow a migration to GPLv3 if that seems like
a good idea, I also ask that people involved with the project make
their preferences known. In particular, if you trust me to make that
decision, you might note so in your copyright message, ie something
like
@DQNEO
DQNEO / 海外登壇.md
Last active November 6, 2023 11:09
海外カンファレンス登壇するためのアドバイス

アメリカGopherConに応募して登壇した経験(2020年、リモート、事前録画)があるので、いくつかアドバイスします

  • 第二言語で登壇するというのはそれだけで素晴らしいこと
  • ネタの探し方
    • オンリーワンなネタ(他のひとがやってなさそうなネタ)を探そう
    • はじめから登壇を意識して、勉強したりOSS活動したりしよう
    • 「作ってみた系」「自分の体験がベース」だとやりやすいかも
  • 日本のカンファレンスで同じネタで登壇しておくとよい
    • 海外登壇するにあたって、「あとは英語化するだけ」になる
  • 米GopherConでは、実現可能性つまり「期日までに準備してちゃんと発表できるか」を説明する必要があり、「すでに自国で発表済みなので、英語化するだけです」といえるので有利
@DQNEO
DQNEO / go.mod
Created June 17, 2023 10:49
log of "go build -n -a -p 1"
module example.com/hello
go 1.20
@DQNEO
DQNEO / build_hello.log
Created June 15, 2023 00:13
log of building hello world by go-build-bash
#
# Initial settings
#
GOOS: darwin
GOARCH: amd64
main module: github.com/DQNEO/go-build-bash/examples/hello
ARG: .
out file:
work dir: /tmp/go-build-bash/w/1686787031
pkgpath='.'
@DQNEO
DQNEO / dict.py
Last active January 27, 2023 02:54
Python script to lookup word definitions from MacOS's builtin dictionary app
#!/usr/bin/env python3
#
# LICSENCE: BSD
#
# Thanks to: https://www.lifewithpython.com/2016/07/python-use-mac-dictionary-app.html
#
import sys
from DictionaryServices import DCSGetTermRangeInString, DCSCopyTextDefinition
def lookup(word):
@DQNEO
DQNEO / buki.txt
Created December 17, 2022 05:39
スプラトゥーン3 武器一覧
スプラシューター
ヒーローシューター レプリカ
.96ガロン
シャープマーカー
わかばシューター
.52ガロン
H3リールガン
L3リールガン
N-ZAP85
ジェットスイーパー
@DQNEO
DQNEO / diff_of_a_merge_commit.txt
Last active June 7, 2022 20:32
How to show diff of a merge commit
$ git diff abcdef^ abcdef
or
$ git show --first-parent abcdef
or
$ git show -m abcdef
http://stackoverflow.com/questions/40986518/git-show-of-a-merge-commit?answertab=votes#tab-top
@DQNEO
DQNEO / go-hello-world.md
Last active February 15, 2022 08:16
Hello world in low level

Rewriting Hello world into the lowest level.

fmt.Print

package main

import (
	"fmt"
)
@DQNEO
DQNEO / replace.sh
Last active October 25, 2021 02:33
add void to setUp and tearDown to PHP test code
#!/bin/bash
#
# a tool to apply return type declarations to "setUp" and "tearDown" for PHPUnit7
# list target files by using GNU grep
grep --files-with-matches -i -w -e setup -e teardown -r tests > /tmp/files
# do substitution
cat /tmp/files | xargs perl -pi -e 's/setUp\(\)$/setUp(): void/g'
cat /tmp/files | xargs perl -pi -e 's/tearDown\(\)$/tearDown(): void/g'
@DQNEO
DQNEO / write_binary.go
Created September 11, 2021 13:20
Write a variable data as binary
package main
import (
"fmt"
"reflect"
"unsafe"
)
type Elf64_Ehdr struct {
e_ident [16]uint8
e_type uint16