View scp-turbo-ssh-tar.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# uses scp syntax e.g.: | |
# REMOTE -> LOCAL | |
# scp-turbo.sh myremote:/etc/apache2 /tmp/mylocal/dir | |
# | |
# LOCAL -> REMOTE | |
# scp-turbo.sh /tmp/mylocal/dir myremote:/home/user32/ | |
# see: >>>> https://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/ |
View ttc2ttf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# depends on: | |
# pip3 install fonttools | |
font="${1}" | |
for n in {1..10} ; do | |
echo $n | |
pyftsubset "${font}" --font-number=${n} \ |
View AsyncTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.example.compat; | |
/* | |
* NOTICE: modified since 2023 and later. | |
* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at |
View SimpTradDetect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.Pattern; | |
public class SimpTradDetect { | |
// data from https://github.com/tsroten/zhon/tree/main/src/zhon/cedict | |
// with shared characters between simplified and traditional removed | |
static final String TRAD = "㠯㵎㼝䠶䰾䳘丟並亂亙亞亾佀佇佈佔併來侖侶侷俁係俠俲俻倀倆倉個們倖倫偉偪側偵偽傌傑傖傘備傚傭傯傳傴債傷傾僂僅僉僑僕僞僥僨僱價儀儂億儈儉儐儔儕儗儘償優儲儷儸儺儻儼兇兌兒兗內兩冊冪凈凍凜凱別刦刧刪刼剄則剉剋剎剛剝剮剴創剷劃劄劇劉劊劌劍劑効勁動務勛勝勞勢勣勦勱勲勳勵勸勻匭匯匱區協卹卻厙厠厭厲厴參叢吳吶呂咷咼員哶唄唚問啞啟啣喚喪喫喬單喲嗆嗇嗎嗚嗩嗶嘆嘊嘍嘓嘔嘖嘗嘜嘩嘮嘯嘰嘵嘷嘸嘽噁噓噝噠噥噦噯噲噴噸噹嚀嚇嚌嚐嚕嚙嚥嚦嚨嚲嚳嚴嚶囀囁囂囅囈囉囌囑囪圇國圍園圓圖團埡執堅堊堖堝堯報場塊塋塏塒塗塚塢塤塲塵塹墊墜墮墳墻墾壇壓壘壙壚壞壟壠壢壩壯壺壼壽夠夢夾奐奧奩奪奮奼妝姍姦姪娛婁婦婭媧媯媼媽嫋嫗嫵嫻嬀嬈嬋嬌嬙嬝嬡嬤嬪嬰嬸孃孌孫學孿宂宮寢實寧審寫寬寳寵寶將專尋對導尒尷屆屍屓屜屢層屨屬屭岡峩峯峴島峽崍崐崑崗崙崢崬嵐嵗嶁嶃嶄嶇嶔嶗嶠嶧嶴嶸嶺嶼嶽巋巒巔巖巹帥師帬帳帶幀幃幇幗幘幚幟幣幫幬幹幾庫廁廂廄廈廕廚廝廟廠廡廢廣廩廬廳廹弒弔弳張強彆彈彊彌彎彙彞彠彥彫彿後徑從徠復徹怳恆恥悅悳悵悶悽惡惥惪惱惲惷惻愙愛愜愨愴愷愾慂慄態慍慘慚慟慣慪慫慮慳慶慼慾憂憊憐憑憒憚憤憫憮憲憶懇應懌懍懟懣懨懲懶懷懸懺懼懾戀戇戔戞戧戩戰戲戶戼抝拋挾捨捫捲掃掄掙掛採揀揚換揮揹損搖搗搯搵搶摑摜摟摯摳摶摻撈撏撐撓撝撟撣撥撧撫撲撳撻撾撿擁擄擇擊擋擔據擠擬擯擰擱擲擴擷擺擻擼擾攄攆攏攔攖攙攛攜攝攢攣攤攪攬敍敗敘敱敵數斂斃斕斬斷旂旹昰時晉晝暈暉暘暢暫暱曄曆曇曉曖曠曡曨曬書會朧朶東柵栢桮桿梔梘條梟棄棖棗棟棧棲椀椏楄楊楓楨業楳極榪榮榿構槍槓槤槧槨槮槳樁樂樅樓標樞樣樸樹樺橈橋機橢橫檁檉檔檜檟檢檣檮檯檳檸檻櫂櫃櫓櫚櫛櫝櫞櫟櫥櫧櫨櫪櫫櫬櫱櫳櫸櫺櫻欄權欏欒欖欞欽歎歐歟歡歲歷歸歿殀殘殞殤殫殭殮殯殲殺殼殽毀毆毿氂氈氌氣氫氬氳氷決沒沖況洶浹涇涖涼淒淚淥淨淪淵淶淺渙減渦測渾湊湞湧湯湼溈準溝溫滄滅滌滎滙滬滯滲滷滸滻滾滿漁漚漢漣漬漲漵漸漿潁潑潔潛潤潯潰潷潿澀澆 |
View applescript-detect-language-objc-bridge.applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use framework "Foundation" | |
use framework "NaturalLanguage" | |
use framework "AVFoundation" | |
-- https://www.macscripter.net/t/detect-language-from-sentence-for-speech-synthesizer/74560 | |
(** | |
* import Foundation | |
* import NaturalLanguage | |
* import AVFoundation |
View macos-tts-say-notification-text.applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set previousList to {} | |
repeat | |
set currentList to {} | |
tell application "System Events" | |
tell process "Notification Center" | |
set allWindows to every window | |
set numWindows to count of allWindows | |
repeat with currentWindow in allWindows | |
try |
View Macos-Applescript-export-notes.applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- modified version from https://bear.app/faq/Import%20&%20export/Migrate%20from%20Apple%20Notes/ | |
-- fixed to write text in UTF8 encoding | |
set exportFolder to (choose folder) as string | |
-- Simple text replacing | |
on replaceText(find, replace, subject) | |
set prevTIDs to text item delimiters of AppleScript | |
set text item delimiters of AppleScript to find | |
set subject to text items of subject |
View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final start = DateTime.now(); | |
final end = start.add(const Duration(days: 0, hours: 30, minutes: 1, seconds: 9)); | |
print(start); | |
print(end); | |
print(getDurationText(start, end)); | |
} | |
String getDurationText(DateTime start, DateTime end) { | |
Duration delta = end.difference(start); |
View macos-set-audio-volume-command-line.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
on run argv | |
log "before: " & output volume of (get volume settings) | |
set volume output volume argv as text | |
log "after: " & output volume of (get volume settings) | |
end run |
NewerOlder