Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Yuichi Tateno (secon) hotchpotch

🌴
On vacation
View GitHub Profile
View nbconvert-markdown-image-embed.rb
#!ruby
require "tmpdir"
require "pathname"
require "base64"
target_nb = ARGF.read
cmd = %w(jupyter nbconvert --to markdown)
png_optimizer_cmd = ["optipng", "-quiet"] # or nil
@hotchpotch
hotchpotch / results.md
Last active Nov 12, 2020
E-M1 mark III get_commandlist.cgi results
View results.md

http://192.168.0.10/get_commandlist.cgi

<oishare>
<version>4.40</version>
<oitrackversion>3.10</oitrackversion>
<support func="web"/>
<support func="remote"/>
<support func="gps"/>
<support func="release"/>
@hotchpotch
hotchpotch / user_profile.ps1
Last active Aug 30, 2020
PowerShell Profile
View user_profile.ps1
# PS Modules
Import-Module posh-git
Import-Module oh-my-posh
Import-Module ZLocation
Set-Theme robbyrussell # お好きなテーマ
Set-PSReadLineOption -EditMode Emacs
@hotchpotch
hotchpotch / settings.json
Created Aug 2, 2020
windows terminal settings.json
View settings.json
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"copyOnSelect": true,
"copyFormatting": false,
"profiles": {
"defaults": {
"closeOnExit": "always",
"colorScheme": "One Half Dark",
View uutils-alias.ps1
# https://scrapbox.io/hotchpotch/MacOS_%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%8C_Windows_%E3%81%AE%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83%E3%82%92%E6%95%B4%E3%81%88%E3%82%8B%E3%81%BE%E3%81%A7
if (Test-Path alias:arch) { Remove-Item alias:arch }
function arch() { $input | uutils arch $args }
if (Test-Path alias:base32) { Remove-Item alias:base32 }
function base32() { $input | uutils base32 $args }
if (Test-Path alias:base64) { Remove-Item alias:base64 }
function base64() { $input | uutils base64 $args }
if (Test-Path alias:basename) { Remove-Item alias:basename }
function basename() { $input | uutils basename $args }
@hotchpotch
hotchpotch / ttf-chars.rb
Created Apr 27, 2020
TTF のフォントデータから含まれる文字をすべて出力する
View ttf-chars.rb
#!/usr/bin/env ruby
#
# base: https://stackoverflow.com/questions/11895641/programmatically-get-a-list-of-characters-a-certain-ttf-font-file-supports
#
require 'ttfunk'
ttf_file = ARGV.shift
ttf = TTFunk::File.open ttf_file
@hotchpotch
hotchpotch / switch_im.json
Created Aug 15, 2018
~/.config/karabiner/assets/complex_modification/switch_im.json
View switch_im.json
{
"title": "Switch IM",
"rules": [
{
"description": "right_control -> CN",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_control"
@hotchpotch
hotchpotch / support_nano_32K_mbed_5.diff
Created Sep 27, 2016
BLE nano V1.5 support mbed OS 5
View support_nano_32K_mbed_5.diff
diff --git a/hal/targets.json b/hal/targets.json
index 7ce4ad8..3e8969c 100644
--- a/hal/targets.json
+++ b/hal/targets.json
@@ -1464,16 +1464,18 @@
"macros_add": ["TARGET_RBLAB_NRF51822"]
},
"RBLAB_BLENANO": {
- "inherits": ["MCU_NRF51_16K"],
- "release_versions": ["2"]
View .minttyrc
BoldAsFont=no
CursorType=block
Font=Ricty Diminished
FontHeight=14
WindowShortcuts=no
Transparency=off
FontSmoothing=full
Term=xterm-256color
Locale=ja_JP
Charset=UTF-8
@hotchpotch
hotchpotch / file0.txt
Last active Aug 29, 2015
A/D コンバータの MCP3002, MCP3208 を raspberry pi 上の Ruby から扱う ref: http://qiita.com/hotchpotch/items/5c47ae210a7a8e9fd6d1
View file0.txt
require 'spi_mcp'
mcp = MCP3208.new
val = mcp.channel(0)
puts val # 0 ~ 4095