Skip to content

Instantly share code, notes, and snippets.

View tsuzu's full-sized avatar
:octocat:
Working/Studying from Home

Tsuzuki Tsuchiya tsuzu

:octocat:
Working/Studying from Home
View GitHub Profile
@tsuzu
tsuzu / matrix.cpp
Created October 24, 2018 00:36
Matrix
#include <iostream>
#include <array>
#include <cstddef>
template<std::size_t H, std::size_t W>
using Matrix = std::array<std::array<int, W>, H>;
template<std::size_t H, std::size_t W>
std::ostream& operator << (std::ostream& os, const Matrix<H, W>& m) {
for(auto& a : m) {
@tsuzu
tsuzu / h2o.cnf
Last active September 16, 2018 14:37
h2o → alp
access-log:
format: "time:%t\thost:%h\treq:%r\tstatus:%s\turi:%U\tmethod:%m\tsize:%b\treferer:%{Referer}i\tua:%{User-Agent}i\tcache:%{X-Cache}o\truntime:%{X-Runtime}o\tvhost:%{Host}i\treqtime:%{request-total-time}x\truntime:%{process-time}x\tapptime:%{duration}x"
# https://lowreal.net/2016/04/06/3
# 微妙にバージョン古くて間違ってる可能性あるので信頼しないでほしいです!!!
@tsuzu
tsuzu / main.go
Created August 27, 2018 14:41
split-go
package main
import (
"fmt"
"io"
"os"
"path/filepath"
"strconv"
)
@tsuzu
tsuzu / main.go
Created April 25, 2018 09:26
情報処理技術2
package main
import (
"fmt"
"sort"
"strconv"
"strings"
"sync"
"sync/atomic"
)
@tsuzu
tsuzu / main.js
Last active June 22, 2018 10:31
Keep hash tags and selected account for Tampermonkey
// ==UserScript==
// @name KeepHashTagAndAccountInTweetDeck Tampermonkey
// @namespace http://tampermonkey.net/
// @version 1.0
// @description https://github.com/zenmaibane/KeepHashTagInTweetDeck for Tampermonkey
// @author Tsuzu
// @match https://tweetdeck.twitter.com
// @grant none
// ==/UserScript==
@tsuzu
tsuzu / notify.go
Created March 26, 2018 06:54
Send notification via IFTTT
func notify(title, msg string) error {
key := os.Getenv("NOTIFY_KEY")
type Payload struct {
Value1 string `json:"value1"`
Value2 string `json:"value2"`
Value3 string `json:"value3"`
}
data := Payload{
@tsuzu
tsuzu / go-easyp2p-test.go
Created March 5, 2018 00:46
go-easyp2p-test.go
package main
import (
"context"
"log"
"sync"
"github.com/cs3238-tsuzu/go-easyp2p"
)
@tsuzu
tsuzu / ddc
Last active February 21, 2018 04:40
ddcctl utility suitable only for my own use
#! /bin/bash
set -eu
DDCCTL=ddcctl
IIYAMA_DISPLAY=1
ASUS_DISPLAY=2
if [ -z "${1-}" ]; then
echo "ddc [initial of display] [subcommand(b/i)] arguments..."
@tsuzu
tsuzu / cgroup.go
Last active December 17, 2016 16:19
Cgroup for Go
package cgroup
import "os"
import "syscall"
import "io/ioutil"
import "strconv"
import "os/exec"
import "strings"
import "errors"
@tsuzu
tsuzu / 5.cpp
Created December 11, 2016 14:00
JOI 2017 Yo 5th
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <cmath>
#include <cstring>
#include <map>
#include <set>