Skip to content

Instantly share code, notes, and snippets.

package main
import (
"context"
"sync"
)
// Dispatcher represents a job dispatcher.
type Dispatcher struct {
sem chan struct{} // semaphore
@rcoh
rcoh / otp.py
Last active September 19, 2025 04:44
An implementation of Google Authenticator Compatible 2-factor Codes
"""
An implementation of TOTP as described in https://tools.ietf.org/html/rfc6238#section-4 aka Google Authenticator Style 2-factor Auth
"""
import base64
import datetime
import hashlib
import hmac
import sys
import struct
import time
@shimizukawa
shimizukawa / README.rst
Last active December 2, 2017 16:48
Sphinx拡張 文字数、翻訳率表示パネル pageinfo.py

Sphinx拡張 文字数表示パネル pageinfo.py に、翻訳率表示を加えた拡張です。

pageinfo.py と pageinfo.html を以下のように配置:

sphinx-project/
+- index.rst
+- conf.py
+- ext/pageinfo.py
+- _templates/pageinfo.html

logging入門

長すぎにならない程度に使い方をまとめてみる。

loggingの使い方

ライブラリの利用者

既に存在するアプリを実行するファイルの場合

@uzimith
uzimith / ignore-slack-user.js
Created September 15, 2017 09:26
ignore-slack-user.js
// ==UserScript==
// @name Ignore slack user
// @namespace https://github.com/uzimith/
// @version 0.1
// @description ignore slack user
// @author uzimith
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
@nyk510
nyk510 / Gpy_vs_sklearn.ipynb
Last active January 12, 2023 10:18
GPy と Scikit-learn のガウス過程の比較
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nakagami
nakagami / HowToWritePythonNoSQLDatabaseDrivers.rst
Last active March 8, 2018 07:27
PyConJP2017 にプロポーザルとして提出した資料(落選)

How to write python NoSQL database driver

Python データーベースドライバーの作り方(NoSQL編)

Profile

@ziadoz
ziadoz / install.sh
Last active December 23, 2025 17:58
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@tcnksm
tcnksm / README.md
Last active December 26, 2016 02:15
Best Golang 記事/発表 2016
@M1suzu
M1suzu / xnu-syscall-life-amd64.md
Created December 10, 2016 22:37 — forked from yrp604/xnu-syscall-life-amd64.md
The life of an XNU unix syscall on amd64

XNU syscall path

Chart

             +------------------+
             |These push their  |                                  +-----------------------+
             |respective syscall|                                  |This overwrites the    |
             |dispatch functions|                                  |saved dispatch function|
             |onto the stack    |                                  |with hndl_alltraps     |