Skip to content

Instantly share code, notes, and snippets.

@moyashi
moyashi / FixFileNameFusion360.py
Last active January 25, 2022 12:36
Fusion360でファイルを開こうとしてエラー「ダウンロードしたファイルが見つかりません。考えられるファイルパス: 」が出た後で実行すると開けるようになることもあるスクリプト
#Author-moyashi
# Fusion360において日本語交じりのファイルを作ると発生するエラー「ダウンロードしたファイルが見つかりません。考えられるファイルパス:」に対処するFusion360用Pythonスクリプト
# エラーが出たらこれを実行するとファイル名が修正されて開けるようになる(こともある)
# 「ツール」>「アドイン」>「スクリプトとアドイン」>「スクリプト」>「作成」で新規スクリプトを作り、コピペして登録。
# Shift + Sで「スクリプトとアドイン」のダイアログが表示できるので、そこから実行が楽。
import adsk.core, traceback
import os, sys
from pathlib import Path
--- robin_nano_cfg_n.txt 2021-07-26 19:21:48.000000000 +0900
+++ robin_nano_cfg_3.txt 2021-07-13 16:48:28.000000000 +0900
@@ -1,7 +1,3 @@
-################# MKS Robin nano configuration #######################
-#此选项只在出厂测试使用
->cfg_hardware_test_enable 0 #硬件测试使能。
-
#===================高级功能设置=======================================
>cfg_insert_det_module 0 #接入断电检测模块(1:mks 220det;0:mks pwc)
set _clipboard to the clipboard
set _lines to paragraphs of _clipboard
set _output to ""
repeat with i in (reverse of _lines)
set _output to _output & i & "
"
end repeat
set the clipboard to _output
@moyashi
moyashi / gist:fdc78da117694686390336b57ad581b8
Last active December 6, 2021 17:14
macOSでCNCコントロールボードへコマンドラインからGrblのhexを書き込む
Arduino IDEを「/Applications/Arduino.app」にインストールしてあり、
書き込み対象のGrblのhexがファイル名「firmware.hex」として「~/Downloads」にあり、
CNCコントロールボードのシリアルポートが「/dev/tty.wchusbserial14510」であると
仮定。
Grblのhexはここにある https://github.com/gnea/grbl/releases
Grbl0.9から1.1へのアップデートをする場合は、事前に$$で設定を書き出し、コピペして保存しておく。
cd ~/Downloads
#!/usr/local/bin/python3
import subprocess
from subprocess import PIPE
array = {"ANYCUBIC MEGA-S":"192.168.1.10",
"ANYCUBIC i3 MEGA":"192.168.1.20",
"KINGROON KP3S-1":"192.168.1.30",
"KINGROON KP3S-2":"192.168.1.40",
"KINGROON KP3S-3":"192.168.1.50",
// ↓これをブックマークに登録
javascript:var%20jumpto%3D%22https%3A%2F%2Fwww.aliprice.com%2FIndex%2Fsearch.html%3Flink%3D%22%20%2B%20encodeURIComponent(String(document.location.href))%3Bwindow.location%3Djumpto%3Bvoid(0);
// iOS用のショートカット(アリエクアプリの「共有ボタン→もっと」から実行)
https://www.icloud.com/shortcuts/0146a2efb16b472d973cf2a3b21fc1a9
// ↓ソース
var jumpto = "https://www.aliprice.com/Index/search.html?link=" + encodeURIComponent(String(document.location.href));
@moyashi
moyashi / getPageTitleAndURLFromFirefox.scpt
Created May 26, 2011 21:33
Firefoxで表示中のページタイトルとURLをカーソル位置にリンクで貼り付けるTypeIt4Me( http://bit.ly/iorZdU )用スクリプト
--「システム環境設定>ユニバーサルアクセス>補助装置にアクセスできるようにする」のチェックボックスをONにする必要あり
--また、環境によってdelay1, delay2を調整する必要があるかもしれません
global format
global delay1
global delay2
--リンクの書式を変える場合はformatを変更
set format to "<a href=\"$url$\" target=\"_blank\">$title$</a>"
#!/usr/bin/env python3
import os
import sys
# pip3 install pyperclip
import pyperclip
# これで実施したマニュアルメッシュベッドレベリングの補正用途: https://github.com/davidramiro/Marlin-Ai3M
# 設定部
@moyashi
moyashi / coincheck_market_price.10s.rb
Last active December 5, 2020 07:02
Coincheck Market Price
#!/usr/bin/ruby
# coding: utf-8
# <bitbar.title>Coincheck Market Price</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>moyashi</bitbar.author>
# <bitbar.author.github>moyashi</bitbar.author.github>
# <bitbar.desc>Test</bitbar.desc>
# <bitbar.image></bitbar.image>
@moyashi
moyashi / level_shifter.py
Last active September 22, 2020 10:37
Marlin-Ai3Mのマニュアルメッシュベッドレベリングの事後補正をするPython3スクリプト ANYCUBIC i3 MEGA / MEGA-S
#!/usr/bin/env python3
import os
import sys
# pip3 install pyperclip
import pyperclip
# これで実施したマニュアルメッシュベッドレベリングの補正用途: https://github.com/davidramiro/Marlin-Ai3M
# 設定部