Skip to content

Instantly share code, notes, and snippets.

View mh61503891's full-sized avatar
🍣

Masayuki Higashino mh61503891

🍣
View GitHub Profile
@mh61503891
mh61503891 / using_gpt_oss_120b_with_tool_calling.py
Created August 16, 2025 22:29
Using gpt-oss:120b with Tool Calling
from openai import OpenAI
LLM_PROMPT = """
Your Prompt to get the score.
"""
LLM_TOOLS = [
{
"type": "function",
"function": {
"name": "get_score",
mas "CotEditor", id: 1024640650
@mh61503891
mh61503891 / app.json
Created November 2, 2024 16:30
Fishing Cat Server: app.json
{
"name": "Fishing Cat Server",
"description": "Fishing Cat Server",
"repository": "https://github.com/fishing-cat/fishing-cat-server",
"website": "https://github.com/fishing-cat/fishing-cat-server",
"keywords": ["phishing", "security", "ruby", "rails", "cat", "rails"],
"scripts": {
"postdeploy": "bundle exec rails db:prepare"
},
"addons": ["heroku-postgresql"],
@mh61503891
mh61503891 / google-tasks-api-example-1.js
Created June 12, 2024 05:10
Google Tasks API example 1
// MaxResults:
// TaskList: 20
// Task: 100 per TaskList
function getTaskCount() {
let count = 0;
Tasks.Tasklists.list({maxResults: 20}).items.forEach(function(taskList) {
const tasks = Tasks.Tasks.list(taskList.id, {
maxResults: 100,
showCompleted: false,
#! /usr/bin/env python3
# Usage:
# $ python3 this.py > output.csv
# $ nkf --overwrite --oc=UTF-8-BOM output.csv
import glob
import hashlib
import os
import sys
@mh61503891
mh61503891 / sshd_config
Created July 16, 2023 12:10
Default config of sshd on Debian GNU/Linux 12.0
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
@mh61503891
mh61503891 / bib.gs
Last active May 24, 2023 10:43
bib.gs
// Googleシートからは `=TOROW(BIB(A1))` のように使う。
function BIB(isbn) {
return _getBibEntriesAsListByIsbn(isbn);
}
function _getBibEntriesAsListByIsbn(isbn) {
const entries = _getBibEntriesAsMapByIsbn(isbn);
return [
entries.isbn,
@mh61503891
mh61503891 / toggle-JIMPrefPunctuationType.sh
Created February 11, 2023 08:14
Toggle JIMPrefPunctuationType
JIMPrefPunctuationTypeKey=$(defaults read com.apple.inputmethod.Kotoeri JIMPrefPunctuationTypeKey)
if [ $JIMPrefPunctuationTypeKey -eq 0 ]; then
defaults write com.apple.inputmethod.Kotoeri JIMPrefPunctuationTypeKey 3
elif [ $JIMPrefPunctuationTypeKey -eq 3 ]; then
defaults write com.apple.inputmethod.Kotoeri JIMPrefPunctuationTypeKey 0
fi
killall -HUP "JapaneseIM-RomajiTyping"
@mh61503891
mh61503891 / main.dart
Last active December 30, 2022 17:53
SnackBar with Riverpod
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
// ...
ref.listen(
snackBarProvider,
(previous, next) {
if (mounted && next != null) {
ScaffoldMessenger.of(context).showSnackBar(next);
}
},
@mh61503891
mh61503891 / bookmarklet-highlight-updated-reports-in-manaba.js
Last active August 22, 2022 12:52
Bookmarklet: Highlight Updated Reports in Manaba
const table = document.getElementsByTagName("table")[2];
for (const row of table.rows) {
try {
const last_submitted_at = new Date(row.cells[3].innerText.split("\n")[0]);
const last_scored_at = new Date(row.cells[6].innerText.split("\n")[0]);
if(last_submitted_at > last_scored_at) {
row.style.backgroundColor = "red";
} else {
/* do nothing */
}