Skip to content

Instantly share code, notes, and snippets.

$buf = "";
document.querySelectorAll("a[href^='/explore/tags/'").forEach(
function(currentValue, currentIndex, listObj) {
$buf = $buf + currentValue.text + " ";
}
);
prompt("", $buf);
tell application "Photos"
set sel to selection
set cnt to contents of sel
class of cnt
set pr to properties of item 1 of cnt
set loc to location of pr
set lat to first item of loc
set lon to second item of loc
set u to "https://www.google.com/maps/place/" & lat & "," & lon & "/"
set the clipboard to u
--- 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 / 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
#!/usr/bin/env python3
import os
import sys
# pip3 install pyperclip
import pyperclip
# これで実施したマニュアルメッシュベッドレベリングの補正用途: https://github.com/davidramiro/Marlin-Ai3M
# 設定部
@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
# 設定部