Skip to content

Instantly share code, notes, and snippets.

View takehaya's full-sized avatar
🏠
Working from home

Takeru Hayasaka takehaya

🏠
Working from home
  • BBSakura Networks, Inc.
  • Tokyo Japan
  • 18:36 (UTC +09:00)
View GitHub Profile
#include <stdio.h>
#include <ctype.h>
#ifndef HEXDUMP_COLS
#define HEXDUMP_COLS 16
#endif
void hexdump(void *mem, unsigned int len)
{
unsigned int i, j;
@null-product
null-product / MainActivity.java
Last active November 30, 2020 22:07
OpenCVでBitmapから四角形を抽出するサンプル
public class MainActivity extends AppCompatActivity {
static {
System.loadLibrary("opencv_java3");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
import hashlib
class MaglevHash(object):
def __init__(self, m=65537):
self.m = m
self.permutation = {}
self.entry = [None] * self.m
def add(self, node):
@jeremywho
jeremywho / main.go
Last active November 26, 2017 17:40
package main
import (
"fmt"
"time"
"github.com/gorilla/websocket"
)
func main() {
@haya14busa
haya14busa / main.go
Created November 1, 2016 23:32
サンプル: Golangにおけるinterfaceをつかったテストで mock を書く技法
package main
import (
"context"
"fmt"
)
type GitHub interface {
CreateRelease(ctx context.Context, opt *Option) (string, error)
GetRelease(ctx context.Context, tag string) (string, error)
@summerwind
summerwind / xdp_load_balancer.c
Last active January 30, 2023 15:04
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);
@asflash8
asflash8 / legend-source.md
Last active October 18, 2023 06:35
ISUCON秘伝のタレ

bash

# change login shell
chsh
# => Login Shell [/bin/sh]: /bin/bash

# bash completion
sudo apt-get install bash-completion
@mono0926
mono0926 / commit_message_example.md
Last active February 11, 2025 06:39
[転載] gitにおけるコミットログ/メッセージ例文集100
/*
* IP checksumming functions.
* (c) 2008 Gerd Hoffmann <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; under version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@jaredhowland
jaredhowland / clear-font-cache.md
Last active May 12, 2025 10:40
Clear Mac OS X Font Caches