Skip to content

Instantly share code, notes, and snippets.

@ak1211
ak1211 / main.py
Created Jul 8, 2021
ak1211 / MyFirstApplication 用赤外線リモコン信号取得と送信用 circuit python プログラム
View main.py
# https://ak1211.com/7707 (main.py)
# Copyright 2021 Akihiro Yamamoto
# Licensed under the Apache License, Version 2.0
from digitalio import DigitalInOut, Direction
import board
import pulseio
import supervisor
import sys
import time
import array
@ak1211
ak1211 / main.py
Last active Jun 16, 2020
赤外線リモコン信号取得と送信用 circuit python プログラム
View main.py
# https://ak1211.com/7586 (main.py)
# Copyright 2020 Akihiro Yamamoto
# Licensed under the Apache License, Version 2.0
from digitalio import DigitalInOut, Direction
import array
import board
import pulseio
import supervisor
import sys
import time
@ak1211
ak1211 / main.py
Last active Jun 16, 2020
赤外線リモコン信号取得用 circuit python プログラム
View main.py
# https://ak1211.com/7586 (main.py)
# Copyright 2020 Akihiro Yamamoto
# Licensed under the Apache License, Version 2.0
import time
import board
import pulseio
from digitalio import DigitalInOut, Direction
# IRM
pulses = pulseio.PulseIn(board.D0, maxlen=2000, idle_state=True)
@ak1211
ak1211 / potic-solver.js
Created Apr 20, 2020
電子ボリュームの減衰値を計算するJavaScript
View potic-solver.js
//
// 電子ボリュームの減衰値を計算するJavaScript
// http://ak1211.com
// Copyright (c) 2018 Akihiro Yamamoto
//
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
@ak1211
ak1211 / irsend.c
Created Jan 2, 2020
irsend プログラム(C言語とpigpioデーモンライブラリ)
View irsend.c
/*
irremocon <https://github.com/ak1211/irremocon>
Copyright 2019 Akihiro Yamamoto
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ak1211
ak1211 / irrec2.c
Created Jan 2, 2020
irrec プログラム(C言語とpigpioデーモンライブラリ)
View irrec2.c
/*
irremocon <https://github.com/ak1211/irremocon>
Copyright 2019 Akihiro Yamamoto
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ak1211
ak1211 / irrec1.c
Created Jan 2, 2020
irrec プログラム(C言語とpigpioライブラリ)
View irrec1.c
/*
irremocon <https://github.com/ak1211/irremocon>
Copyright 2019 Akihiro Yamamoto
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
View csvtodb.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ak1211
ak1211 / accessGitHubTraffic.py
Last active Nov 20, 2018
GitHub Trafficをpythonで取得したい
View accessGitHubTraffic.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, json, functools
from urllib2 import urlopen, Request
# GitHub Traffic API
# https://developer.github.com/v3/repos/traffic/
def openTrafficAPI (owner, repo, token, path):
url = "https://api.github.com/repos/%s/%s/traffic/%s" % (owner, repo, path)
headers = {
@ak1211
ak1211 / gist:52b8c5f23a62936f213a
Created Mar 2, 2016
対応する開始ログがない終了ログは,標準エラー出力に送る
View gist:52b8c5f23a62936f213a
for item in itertools.ifilter(lambda it:it["start log"] == None, terminate_session_logs):
print >> sys.stderr, "This record,"
print >> sys.stderr, item["line"] ,
print >> sys.stderr, " has no relationship!"