Skip to content

Instantly share code, notes, and snippets.

@umyuu
umyuu / ppm.py
Created July 15, 2018 18:19
ImageTk.PhotoImage alternative opencv cv2.imencode & tk.PhotoImage
```Python
# -*- coding: utf-8 -*-
"""
poc 2
opencvを使って、PhotoImageの処理を代替する。
"""
import asyncio
from concurrent.futures import ThreadPoolExecutor as PoolExecutor
#from concurrent.futures import ProcessPoolExecutor as PoolExecutor
from contextlib import closing
@umyuu
umyuu / Bookmarklet Sample
Last active May 12, 2018 03:18
Bookmarklet code golf
javascript:(function(){let s=document.createElement('script');s.src='https://umyuu.github.io/version_switcher/src.js';document.querySelector('body').prepend(s);})();
```Python
def trace_calls(frame, event, arg):
if event != 'line':
return trace_calls
from functools import lru_cache
from linecache import getline
@lru_cache(maxsize=128)
def line_cache(filename: str, line_no: int):
return getline(filename, line_no).rstrip()

#メモ

質問文のソースコード部分はcodeタグで囲ってくださいな。 https://teratail.com/help/question-tips#questionTips3-5

var keys = {
    'api': 'APIキー',
    'secret': 'secretキー'
};
function get_nonce(){
  return  (new Date().getTime() / 1000).toFixed(0);
}
function toHexString(data) {
 return data.map(function(e) {