Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@lincerely
lincerely / toggle monospace font.applescript
Created June 16, 2024 01:30
CotEditor toggle monospace font
tell application "CotEditor"
set curfont to do shell script "defaults read com.coteditor.CotEditor fontName"
if curfont is "Osaka-Mono" then
do shell script "defaults write com.coteditor.CotEditor fontName Osaka"
do shell script "defaults write com.coteditor.CotEditor showPageGuide -bool no"
else if curfont is "Osaka" then
do shell script "defaults write com.coteditor.CotEditor fontName Osaka-Mono"
do shell script "defaults write com.coteditor.CotEditor showPageGuide -bool yes"
end if
end tell
#include "voicevox_core/voicevox_core.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv)
{
if (argc < 3) {
fprintf(stderr, "%s SPEAKER_ID TEXT\n", argv[0]);
return 1;
@lincerely
lincerely / .gitignore
Created March 16, 2024 21:44 — forked from TooTallNate/.gitignore
low-level objc runtime apis
*
!*.m
!Makefile
@lincerely
lincerely / unpack_prefab.c
Created December 9, 2023 05:26
unpack embedded .rmf objects from .ol WorldCraft prefab library to current directory
// unpack embedded .rmf objects from .ol WorldCraft prefab library to current directory.
// list of names and descriptions would be dump into info.txt.
// reference: https://github.com/LogicAndTrick/sledge-formats/blob/master/Sledge.Formats.Map/Formats/WorldcraftPrefabLibrary.cs
#include <stdio.h>
#include <string.h>
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#!/usr/local/bin/bbe -f
# NEC特殊罫線 -> SJIS 変換
# reference: https://hide.maruo.co.jp/lib/hmconv/neckeisen100.html
s/\x86\xA2/\x84\x9F/
s/\x86\xA3/\x84\xAA/
s/\x86\xA4/\x84\xA0/
s/\x86\xA5/\x84\xAB/
s/\x86\xA6/\x84\x9F/
s/\x86\xA7/\x84\xAA/
s/\x86\xA8/\x84\xA0/
@lincerely
lincerely / arm_c.txt
Last active September 13, 2023 01:55
Android compile c executable with NDK
$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang hello.c
adb push a.out /data/local/tmp/hello
adb shell
chmod 755 /data/local/tmp/hello
/data/local/tmp/hello
@lincerely
lincerely / pdfoutline.sh
Last active September 6, 2023 14:14
add outline to PDF using ghostscript and PDFMark
#!/usr/bin/env bash
# add outline to PDF using ghostscript and PDFMark
# reference: https://www.meadowmead.com/wp-content/uploads/2011/04/PDFMarkRecipes.pdf
if [ $# -lt 2 ]; then
echo "usage: $0 INPDF OUTPDF < OUTLINE"
echo '
Outline example:
1 Title
@lincerely
lincerely / Show in Album.applescript
Created March 17, 2023 19:27
This script opens the album where the selected photo is in.
# Show in Album
#
# This script opens the album where the selected photo is in.
# If the photo is in multiple albums, it displays a list to choose from.
#
# It assumes:
# - no album with duplicate names; and
# - no folder/album with the same name in the same folder; and
# - your UI is in English, if not then you need to change the menu item name in the last part of the script.
#
@lincerely
lincerely / xsshot.sh
Created February 13, 2023 16:41
take X11 screenshot and output PNG to STDOUT
#!/usr/bin/env bash
#xsshot.sh - take X11 screenshot and output PNG to STDOUT
xwd | xwdtopnm | pnmtopng