Skip to content

Instantly share code, notes, and snippets.

View musaprg's full-sized avatar
🐱
meow meow

Kotaro Inoue musaprg

🐱
meow meow
View GitHub Profile
@musaprg
musaprg / karabiner.json
Created April 9, 2025 04:41
Karabiner Elements Config to switch key locale
{
"profiles": [
{
"devices": [
{
"disable_built_in_keyboard_if_exists": true,
"identifiers": {
"is_keyboard": true,
"product_id": 256,
"vendor_id": 2131
@musaprg
musaprg / .cursorrules
Created January 13, 2025 10:27 — forked from fumiya-kume/.cursorrules
.cursorrules in 2025/01/11
# .cursorrules
# Development Steps for CLI Application in Go
## 1. Overall Design
- Define the purpose and scope of the CLI application.
- Identify the target audience and their needs.
- Outline the main features and functionalities.
- Create a high-level architecture diagram.
- **Improve Specifications/Features:**
@musaprg
musaprg / keybindings.json
Created July 25, 2023 03:56
Ctrl+nでexplorerをトグルするようにすることでVimのnerdtreeと使い勝手を統一するやつ
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
@musaprg
musaprg / sync-annict-epgstation.sh
Created June 25, 2023 03:37
AnnictとEPGStationの録画予約を同期するscript(cronにそのまま突っ込むためのやつ)
#!/bin/bash
set -eu
# You need to install annict-epgstation-connector first.
# $ brew tap musaprg/tap
# $ brew install annict-epgstation-connector
ANNICT_API_TOKEN=put-your-annict-token-here
@musaprg
musaprg / main.zig
Last active March 11, 2023 18:04
http client test with zig on master channel
const std = @import("std");
const heap = std.heap;
const http = std.http;
const Uri = std.Uri;
const debug = std.debug;
pub fn main() anyerror!void {
var arena = heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const allocator = arena.allocator();
@musaprg
musaprg / action.js
Created February 23, 2023 08:53
Auth0 Action for the Discord Guild Member Authorization
const { Client, Intents } = require('discord.js');
/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {
const identities = event.user.identities.filter((v) => { return v.connection == "discord"; });
const std = @import("std");
const os = std.os;
const fs = std.fs;
const fmt = std.fmt;
const heap = std.heap;
const ArenaAllocator = heap.ArenaAllocator;
const linux = os.linux;
const print = std.debug.print;
// no interface natively in zig for now
@musaprg
musaprg / main.zig
Created July 25, 2022 15:00
親の顔より見たfork-exec
const std = @import("std");
const os = std.os;
const linux = os.linux;
const print = std.debug.print;
fn parent(_: usize) !void {
os.exit(0);
}
fn child() !void {