Skip to content

Instantly share code, notes, and snippets.

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

#メモ

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

```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()
@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);})();
@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 / generate_random_number.java
Last active July 16, 2018 10:00
Java 乱数生成いろいろ。
```Java
import java.util.Random;
import java.util.Arrays;
class Wandbox
{
public static void main(String[] args)
{
final Random rnd = new Random();

◇スクリーンショット

Shortcut Key 内容
Win + Print Screen ファイル名を付けて画面を保存
Win + Shift + S 範囲を指定してクリップボードにコピー

◇ファイルパスのコピー

| Shortcut Key | 内容 |

Pythonのjson#loadを呼び出し時のスタックトレース

◇確認方法 PyCharmでブレイクポイントを設置。 ◇ソースコード

with open(str(file_name), encoding='utf-8') as f:
    lines = json.load(f)