Skip to content

Instantly share code, notes, and snippets.

@ogatatsu
ogatatsu / gist:6e1e9970d55975f0cd44fc50bd82d373
Created January 26, 2024 23:20
HHKB Studio Hid Descriptor
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
0x85, 0x7F, // Report ID (127)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0xE0, // Usage Minimum (0xE0)
0x29, 0xE7, // Usage Maximum (0xE7)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x08, // Report Count (8)
sudo apt update -y
sudo apt upgrade -y
sudo apt install build-essential -y
sudo apt install gcc-arm-none-eabi -y
sudo apt install python3-pip -y
sudo pip3 install adafruit-nrfutil
sudo pip3 install intelhex
git clone https://github.com/ogatatsu/Adafruit_nRF52_Bootloader.git
cd Adafruit_nRF52_Bootloader
sudo apt update
sudo apt upgrade
sudo apt install build-essential
sudo apt install libgmp-dev
sudo apt install libmpc-dev
sudo apt install libmpfr-dev
wget http://core.ring.gr.jp/pub/GNU/binutils/binutils-2.33.1.tar.gz
tar xvzf binutils-2.33.1.tar.gz
cd ./binutils-2.33.1
@ogatatsu
ogatatsu / cloudSettings
Last active August 8, 2020 10:10
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-08T10:10:20.923Z","extensionVersion":"v3.4.3"}
@ogatatsu
ogatatsu / MXErgo_HID_Descriptor.h
Created January 10, 2020 11:46
HID Descriptor
char ReportDescriptor[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xa1, 0x01, // COLLECTION (Application)
0x85, 0x02, // REPORT_ID (2)
0x09, 0x01, // USAGE (Pointer)
0xa1, 0x00, // COLLECTION (Physical)
0x95, 0x10, // REPORT_COUNT (16)
0x75, 0x01, // REPORT_SIZE (1)
Frame 17: 93 bytes on wire (744 bits), 93 bytes captured (744 bits) on interface 0
USB URB
[Source: 3.15.0]
[Destination: host]
USBPcap pseudoheader length: 28
IRP ID: 0xffffd48c68507520
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
IRP information: 0x01, Direction: PDO -> FDO
URB bus id: 3
def test(): Unit = {
for(i <- 1 to 10) {
println(i);
if(i == 5) return;
}
println("test"); //実行されたら気持ち悪い
}
@ogatatsu
ogatatsu / readme.md
Created June 27, 2012 11:10 — forked from j5ik2o/gist:2996293
リトライハンドラー 魔改造
object RetryUtil {
import scala.util.control.Exception.allCatch
case class RetryResult[T](e: Either[List[Throwable], T]) {
def `catch`(f: List[Throwable] => T): T = e match {
case Right(r) => r
case Left(l) => f(l)
}
}
@ogatatsu
ogatatsu / gist:1518754
Created December 25, 2011 05:10 — forked from j5ik2o/gist:1518723
こんな構文で階層型のログ出力をしたい
def connect = {
log("connect") { // connect start
// ... 何かの処理 ...
log("login") { // connect : login start
// ... 何かの処理 ...
} // connect : login end
// ... 何かの処理 ...
} // connect end
}
@ogatatsu
ogatatsu / joinRight
Created December 13, 2011 17:02
joinRightサンプル
scala> val a: Either[Exception, Either[Exception, Int]] = Right(Right(10))
a: Either[Exception,Either[Exception,Int]] = Right(Right(10))
scala> a.joinRight
res0: Either[Exception,Int] = Right(10)
scala> val b: Either[Exception, Either[Exception, Int]] = Right(Left(new Exception("a")))
b: Either[Exception,Either[Exception,Int]] = Right(Left(java.lang.Exception: a))
scala> b.joinRight