Skip to content

Instantly share code, notes, and snippets.

Hajime Nakagami nakagami

Block or report user

Report or block nakagami

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
@nakagami
nakagami / darts_sample.cpp
Last active Oct 11, 2019
Darts (Double-ARray Trie System) http://chasen.org/~taku/software/darts/ sample code.
View darts_sample.cpp
#include <iostream>
#include <darts.h>
// Darts http://chasen.org/~taku/software/darts/ sample code
int main (int argc, char **argv)
{
using namespace std;
const Darts::DoubleArray::key_type *str[] = { "ALGOL", "ANSI", "ARCO", "ARPA", "ARPANET", "ASCII" }; // same as char*
View swine_fever.rst

豚コレラと家畜衛生について

2019-09-10 BPLL #37 https://bpstudy.connpass.com/event/143999/

最近、「豚コレラ」という言葉を時々ニュースで聞くが、それが農家や農政に重大な危機であることがあまり知られてないのではないかと思う。 この危機を知ってもらいたい。

お前誰よ

@nakagami
nakagami / qrcode_view.py
Last active Sep 2, 2019
QR コードを png 画像として返す Django の view関数のコードスニペット
View qrcode_view.py
def qrsample(request):
import qrcode # pip install qrcode, pillow
from django.shortcuts import redirect
from django.http.response import HttpResponse
if request.method == "GET":
redirect('/')
qr = qrcode.QRCode(
error_correction=qrcode.constants.ERROR_CORRECT_H,
@nakagami
nakagami / mp4togif.py
Created Jul 2, 2019
mp4 to animation gif converter
View mp4togif.py
#!/usr/bin/env python3
import sys
import imageio
"""
Convert mp4 to (animation) gif.
Reference: http://imageio.readthedocs.io/en/latest/examples.html#convert-a-movie
pip install imageio, imageio-ffmpeg
"""
View db2_on_cloud.rst
@nakagami
nakagami / python_and_db2.rst
Last active May 11, 2019
Python database driver and Db2
View python_and_db2.rst
@nakagami
nakagami / quickstartdjango.rst
Last active Apr 7, 2019
Quickstart with Django and pure python database drivers (2019-04-06)
View quickstartdjango.rst
View firebirdsql_sqlx_example.go
package main
import (
"database/sql"
"fmt"
"log"
"github.com/jmoiron/sqlx"
_ "github.com/nakagami/firebirdsql"
)
View tokyoex9.rst
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elixir のプロジェクトに Pull Request を送った
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tokyo.ex #9 https://beam-lang.connpass.com/event/103873/
LT
2018-10-21
=============
自己紹介
@nakagami
nakagami / pg_scram_sha_256.py
Created Sep 24, 2018
PostgreSQL SCRAM-SHA-256 authentication
View pg_scram_sha_256.py
import hashlib
import hmac
import base64
import binascii
password = 'foobar'
client_nonce = '9IZ2O01zb9IgiIZ1WJ/zgpJB'
server = {
'r': '9IZ2O01zb9IgiIZ1WJ/zgpJBjx/oIRLs02gGSHcw1KEty3eY',
's': 'fs3IXBy7U7+IvVjZ',
You can’t perform that action at this time.