Skip to content

Instantly share code, notes, and snippets.

@m-thomson
m-thomson / airtable-to-csv.php
Last active March 13, 2021 11:33
Dump airtable contents to CSV
<?php
/*
* Totally simple way to dump an Airtable to CSV.
* Uses https://github.com/sleiman/airtable-php
*/
// When true, first field is the row number (starting with 1)
define("NUMBER_OUTPUT_ROWS", true);
@shibacow
shibacow / fetch_law.py
Created September 13, 2017 17:02
e-Gov法令検索 http://elaws.e-gov.go.jp/download/lawdownload.html から法令データの一括ダウンロードを行う。10秒のインターバルをしている
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
from pyquery import PyQuery as pq
from datetime import datetime
import re
import os
import shutil
import time
@betaEncoder
betaEncoder / STM32_programming_tips.md
Last active May 15, 2025 05:50
Tips for STM32 self programming

STM32のFlashメモリを書き換える時のメモ

アプリケーションによっては,製品出荷時にユニークなIDを記憶させたり,キャリブレーション値を保持する時にMCU内蔵のEEPROMへデータを書き込む事があります.
しかしながら,STM32シリーズのチップにはEEPROMがありません.どうやらFlashメモリをEEPROMのように書き換えて使う想定のようです.

Flash特有の懸念

FLASHメモリと言えば書き換え可能な回数が限られており,頻繁な書き換えは信頼性の低下が懸念されます.
そこでデータシートを参照してみると,最低でも1万回の書き換えが保証されているようでした.   これならループを回して書き換えたりしない限り,メモリの劣化は考えなくても良さそうです.
懸念はそれだけではありません.Flashメモリは1バイトづつ書き込む事はできるものの,消去はセクタ単位での一括消去となります.故に,書き換える場合には以下の手順が必要です.

@CarlosGS
CarlosGS / raspberry_fast_capture.py
Last active February 26, 2024 04:16
Fast reading from the raspberry camera with Python, Numpy, and OpenCV. See the comments for more details.
# Fast reading from the raspberry camera with Python, Numpy, and OpenCV
# Allows to process grayscale video up to 124 FPS (tested in Raspberry Zero Wifi with V2.1 camera)
#
# Made by @CarlosGS in May 2017
# Club de Robotica - Universidad Autonoma de Madrid
# http://crm.ii.uam.es/
# License: Public Domain, attribution appreciated
import cv2
import numpy as np

思いつつままに書いてみたが、自分でもなんかしっくりこないので、WIP。同期縛りだからReduxのReducerがダメ、という自分の主張のコアの部分に自信がない。それを差し置いて呼んでほしい。

(1) https://togetter.com/li/911228 (2) http://qiita.com/mizchi/items/8cf4e0c868f5c49ebcbf

redux

いろいろあって仕方なく覚えることにした。今度こそ好きになれるかと思って勉強したが、無理そうな気配を感じている。これで3度目ぐらいの挫折。挫折、というか理解はしたと思う。理解をした上で好きになれない。まだ真の理解に至ってないという可能性はあるが…

昔勉強した際の、生JSの癖に関数合成を多用して見づらい、というのは FlowやTypeScriptの表現力でカバーできるようになったことで、ある程度解決したと思う。というかボイラープレートを超えると、それらはさして問題ではなかった。そこから先。

@chsh
chsh / Flat UI Colors.clr
Last active May 14, 2025 09:38
Some color pallets with Apple Color List (.clr) format
@ksasao
ksasao / Program.cs
Created November 22, 2016 13:49
コマンドプロンプトで UWP の音声認識APIを利用するサンプル。NuGet で UWPDesktop を追加してください。https://blogs.msdn.microsoft.com/lucian/2015/10/23/how-to-call-uwp-apis-from-a-desktop-vbc-app/
// コマンドプロンプトで UWP の音声認識APIを利用するサンプル
// NuGet で UWPDesktop を追加してください。
// https://blogs.msdn.microsoft.com/lucian/2015/10/23/how-to-call-uwp-apis-from-a-desktop-vbc-app/
using System;
using Windows.Media.SpeechRecognition;
namespace UWPCommandLine
{
class Program
{
@shimizu
shimizu / .block
Last active May 29, 2024 04:38
バイナリベクトルファイル(pbf)の作り方
license: mit
height: 1200
@vxgmichel
vxgmichel / aioudp.py
Last active March 16, 2026 20:09
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
Example:
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one
@328
328 / 0sim_get_use_month.rb
Last active September 30, 2016 13:52
0simの今月の使用量を取ってくるrubyスクリプト
require 'nokogiri'
require 'mechanize'
loginid = ''
password = ''
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari 4'
agent.get('https://www.so-net.ne.jp/retail/u/userMenu/') do |page|
login = page.form_with(:name => 'Login') do |form|