Skip to content

Instantly share code, notes, and snippets.

😑
職業プログラマは無期休業中。

Der Spiegel im Spiegel spiegel-im-spiegel

😑
職業プログラマは無期休業中。
Block or report user

Report or block spiegel-im-spiegel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active Nov 16, 2018
日能研の問題をGo言語で力づくで解いてみた(2018/11) ref: https://qiita.com/spiegel-im-spiegel/items/90332789f8a6f98c670d
View file0.go
package main
import "fmt"
func Permutations(cards []int) <-chan []int {
ch := make(chan []int)
go func() {
defer close(ch)
perm(ch, make([]int, 0, len(cards)), cards)
}()
@spiegel-im-spiegel
spiegel-im-spiegel / .goreleaser.yml
Last active Oct 21, 2018
GOPATH モードからモジュール対応モードへ移行せよ ref: https://qiita.com/spiegel-im-spiegel/items/5cb1587cb55d6f6a34d7
View .goreleaser.yml
builds:
- env:
- GO111MODULE=on
View config.cson
"*":
core:
customFileTypes:
"source.perl6": [
"pl"
"cgi"
]
@spiegel-im-spiegel
spiegel-im-spiegel / file0.pl
Last active Jan 23, 2018
Go 言語でも (a==1 && a==2 && a==3) を true にしてみたい(クソリプ編) ref: https://qiita.com/spiegel-im-spiegel/items/16b15d0c646e2a0e3e7d
View file0.pl
use strict;
use warnings;
my $a = 1;
my @a = (1, 2);
sub a { 3 };
if ($a == 1 and @a == 2 and &a == 3) {
print "True!\n";
}
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active May 27, 2019
Go 言語で改行コードを変換する(正規表現以外の解) ref: https://qiita.com/spiegel-im-spiegel/items/f1cc014ecb233afaa8af
View file0.go
package main
import (
"fmt"
"regexp"
)
var regxNewline = regexp.MustCompile(`\r\n|\r|\n`) //throw panic if fail
func convNewline(str, nlcode string) string {
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active Oct 27, 2017
バイナリデータを Golang の []byte リテラル表記に変換する簡単なお仕事 ref: http://qiita.com/spiegel-im-spiegel/items/272c1b8c01eb287059e0
View file0.go
package godump
import (
"bytes"
"fmt"
"io"
)
//DumpBytes returns []bytes literal string
func DumpBytes(r io.Reader, name string) (io.Reader, error) {
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Created Oct 19, 2017
バイト列を整数に変換する簡単なお仕事メモ(Go言語) ref: http://qiita.com/spiegel-im-spiegel/items/1eb8bcb44c946aa5920d
View file0.go
package main
import (
"encoding/binary"
"fmt"
)
func main() {
octets := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}
@spiegel-im-spiegel
spiegel-im-spiegel / file0.rb
Last active Sep 30, 2017
クラスとオブジェクトの関係性(Go 言語編) ref: http://qiita.com/spiegel-im-spiegel/items/2da5e5902aa2cb6d9e30
View file0.rb
class Taiyaki
def atama
puts "たい焼きの頭の方にはあんこがいっぱい入っている"
end
def shippo
puts "たい焼きの尻尾にはあんこがほとんど入っていない"
puts "しかしカリカリしていて美味しい"
end
end
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active Jun 25, 2017
Go 言語における無効日付(2月31日など)の扱い ref: http://qiita.com/spiegel-im-spiegel/items/42d115471cf2b5a80437
View file0.go
package main
import (
"fmt"
"time"
)
func main() {
tm := time.Date(2017, 1, 31, 0, 0, 0, 0, time.UTC)
for i := 0; i < 6; i++ {
@spiegel-im-spiegel
spiegel-im-spiegel / file1.txt
Last active Mar 7, 2017
「プレミアムフライデー」を求める関数を作ってみた ref: http://qiita.com/spiegel-im-spiegel/items/6eb5702cad251e01db4d
View file1.txt
$ go run pf.go 2017 2
24
You can’t perform that action at this time.