Skip to content

Instantly share code, notes, and snippets.

View naotaco's full-sized avatar
📷
Dreaming of going out for photography

Nao taco naotaco

📷
Dreaming of going out for photography
  • Japan
View GitHub Profile
@naotaco
naotaco / rpi4.cfg
Last active September 8, 2020 18:07
OpenOCD config file for Raspberry Pi4
set _CHIPNAME rpi4
set _DAP_TAPID 0x4ba00477
adapter_khz 8192
# taken from the forum: https://www.raspberrypi.org/forums/viewtopic.php?t=252551
transport select jtag
reset_config trst_and_srst
[7] [8]
extractbb:warning: Can't find file (/c/work/review/rust-embedded3/images/02_exception_interrupt/fig1.png), or it is forbidden to read ...skipping
LaTeX Warning: File `/c/work/review/rust-embedded3/images/02_exception_interrup
t/fig1.png' not found on input line 84.
./02_exception_interrupt.tex:84: LaTeX Error: Cannot determine size of graphic
@naotaco
naotaco / Makefile
Last active August 25, 2019 06:22
Makefile for Re:View project
# directory contains .re files
CONTENTS_DIR := contents
# output files
BOOK_NAME := rust-embedded2
OUT_PDF := $(BOOK_NAME).pdf
OUT_EPUB := $(BOOK_NAME).epub
# dependencies
SRCS := $(wildcard $(CONTENTS_DIR)/*.re) $(wildcard *.yml) $(wildcard sty/*.sty) $(wildcard sty/*.cls)
@naotaco
naotaco / nginx_cosmic.diff
Last active January 9, 2019 15:07
Use cosmic as nginx env instead of debain/stretch
diff --git a/mainline/stretch/Dockerfile b/mainline/stretch/Dockerfile
index 09e2d84..1f96b37 100644
--- a/mainline/stretch/Dockerfile
+++ b/mainline/stretch/Dockerfile
@@ -1,9 +1,10 @@
-FROM debian:stretch-slim
+FROM ubuntu:cosmic
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
@naotaco
naotaco / gen_users.sh
Last active October 5, 2018 16:44
適当にnginx用のid/password生成する君
#!/bin/bash
# Usage: ./gen_users.sh [num] [dest_dir(option)]
NUM=$1 # number of accounts
DIR_NAME=$2
PW_FILE=./.htpasswd # for nginx setting
CSV_FILE=./id_list.csv # for print
@naotaco
naotaco / main.rs
Created December 12, 2017 13:19
main.rs
// Originally published here: https://github.com/avr-rust/blink
#![feature(asm, lang_items, unwind_attributes)]
#![no_std]
#![no_main]
extern crate arduino;
use arduino::{DDRB, PORTB};
use core::ptr::write_volatile;
@naotaco
naotaco / property.snippet.xml
Created December 30, 2016 04:52
A snippet to create bindable property on VisualStudio
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Property</Title>
<Shortcut>pp</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
@naotaco
naotaco / Makefile
Created October 1, 2016 14:21
Makefile sample for AVR program with USBasp
TARGET = atmega88
COMPILE = avr-gcc -Wall -O2 -I. -mmcu=$(TARGET) # -DDEBUG_LEVEL=2
OBJECTS = main.o
all: main.hex
.c.o:
@naotaco
naotaco / main.c
Created October 1, 2016 14:20
LED blink code for AVR
#include <avr/io.h>
#define F_CPU 8000000UL //8MHz
#include <util/delay.h>
int main(void){
DDRC = 0x02; // C1 to output
CLKPR = (1 << CLKPCE); // Enable clock change
CLKPR = 0; // 0 to 1-div clock (max speed = 8MHz)
for(;;){
{
// somewhere
Slider.ThumbToolTipValueConverter = new SliderValueConverter() { Labels = new List<string>(){"a", "b", "c"} };
}
public class SliderValueConverter : IValueConverter
{
public List<string> Labels { get; set; }
public object Convert(object value, Type targetType, object parameter, string language)