Skip to content

Instantly share code, notes, and snippets.

@ytsuboi
ytsuboi / Dots.cpp
Created October 18, 2011 06:34
12x2ピンなドットマトリクスLED用、Dots.cppのピン定義
Dots::Dots()
{
/* 秋月用
_rowPins[0] = 9;
_rowPins[1] = 4;
_rowPins[2] = 10;
_rowPins[3] = 6;
_rowPins[4] = 17;
_rowPins[5] = 11;
_rowPins[6] = 16;
@ytsuboi
ytsuboi / TweetbotQuickAffiliate.js
Created November 8, 2011 11:15
iPhoneのSafariからAmazonのアフィリリンクをTweetbotに投げるブックマークレット
javascript:tracking_id = "yoshisweb-22";
twitter_id="ytsuboi";
pf = "http://www.amazon.co.jp/exec/obidos/ASIN/";
d = document;
u = d.location.href;
re = new RegExp("^http://www.amazon.co.jp/gp/aw/d/([0-9A-Z]{10})");
res = u.match(re);
if (res) {
asin = res[1];
afurl = pf + asin + "/" + tracking_id + "/ref=nosim/";
@ytsuboi
ytsuboi / Portfile
Created December 11, 2011 15:59
MacPorts Portfile for avr-binutils @2.20.1a_1
# $Id: Portfile 78408 2011-05-07 00:01:50Z [email protected] $
PortSystem 1.0
name avr-binutils
version 2.20.1a
revision 1
# Parameters for this port.
set crossgcc-target avr
@ytsuboi
ytsuboi / cream-dxf6.ulp
Created June 1, 2012 14:23
cream-dxfのEAGLE 6対応版(開発中)
まじめにやって、
https://github.com/SWITCHSCIENCE/ssci-eagle-public/blob/master/cream-dxf.ulp
こちらに置きました。
EAGLE 6では、スケールが1/31.75と聞いていましたが、ドキュメントによると1/32なので、そのように直してあります。
一応、10x5mmのtCreamレイヤを書いてEAGLE 6で1/32したところ、10x5mmだったので、1/32を採用しました。
@ytsuboi
ytsuboi / gist:3018311
Created June 29, 2012 14:38
How to download the ADK ( Accessory Development Kit ) 2012 source
On my Mac, I did this.
-- Install repo to MacPorts directory
$ sudo curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /opt/local/bin/repo
$ sudo chmod a+x /opt/local/bin/repo
-- Grab the source
$ mkdir android-accessories
$ cd android-accessories/
$ repo init -u https://android.googlesource.com/accessories/manifest
$ repo sync
@ytsuboi
ytsuboi / gist:3027999
Created July 1, 2012 11:16
Raspberry Piのdmesg
Linux version 3.1.9+ (grayg@dc4-arm-01) (gcc version 4.5.1 (Broadcom-2708) ) #90 Wed Apr 18 18:23:05 BST 2012
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: BCM2708
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 49152
free_area_init_node: node 0, pgdat c03b5660, node_mem_map c0402000
Normal zone: 384 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 48768 pages, LIFO batch:15
@ytsuboi
ytsuboi / ir_send.ino
Created January 8, 2013 14:20
Arduinoを赤外線リモコンにするスケッチ。 とりあえず家電協とNECフォーマットに対応。たぶんSONYフォーマットにも対応させます。
/*
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2013 Yoshihiro TSUBOI <ytsuboi-at-gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
@ytsuboi
ytsuboi / DAP_config.patch
Created April 2, 2013 09:33
a patch for DAP_config.h of NXP's AN11321, to get works on my CMSIS-DAP adapter.
--- DAP_config.h.orig 2013-04-02 16:54:01.248627100 +0900
+++ DAP_config.h 2013-03-31 13:48:38.999248900 +0900
@@ -38,6 +38,7 @@
//#include <LPC43xx.H> // Debug Unit Cortex-M Processor Header File
#include <LPC11Uxx.h>
+#include "gpio.h"
/// Processor Clock of the Cortex-M MCU used in the Debug Unit.
/// This value is used to calculate the SWD/JTAG clock speed.
@ytsuboi
ytsuboi / gist:7367769
Created November 8, 2013 08:04
Galileoのdmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.8.7-yocto-standard (clntonsw@irsswdev001) (gcc version 4.7.2 (GCC) ) #1 Tue Oct 1 00:07:32 IST 2013
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000096fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000097000-0x0000000000097fff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000098000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000000f0defff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000f0df000-0x000000000f11efff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000000f11f000-0x000000000f1defff] reserved
@ytsuboi
ytsuboi / erase_nrf51822.py
Created June 28, 2014 06:59
nRF51822のflashをCMSIS-DAPで消すツール(要pyOCD)
#!/usr/bin/env python
import argparse
from time import sleep, time
from struct import unpack
import sys
import subprocess
from pyOCD.interface import INTERFACE, usb_backend
from pyOCD.board import MbedBoard