Skip to content

Instantly share code, notes, and snippets.

@takoeight0821
takoeight0821 / fzf-code.zsh
Last active May 29, 2025 02:03
ripgrepの結果を下にVSCodeを開くコマンドと、shift shiftでターミナルにフォーカスするショートカット
function fzf-code() {
local file
local line
local query="${LBUFFER:-.}"
read -r file line <<<"$(rg --no-heading --line-number $query | fzf -0 -1 | awk -F: '{print $1, $2}')"
if [[ -n $file ]]
then
@takoeight0821
takoeight0821 / copymd.sh
Created February 27, 2025 01:27
Webページをmarkdownとしてコピーするコマンド(zsh)
function copymd() {
curl -s $1 | pandoc -f html -t markdown | pbcopy
}
@takoeight0821
takoeight0821 / Program.cs
Created December 3, 2023 14:23
RPG EDSL
// アイテムやスキルの効果を、プログラム上のデータとして表現し、それを解釈・実行することで各パラメータを算出する。
// EDSL (Embedded Domain Specific Language 組み込みDSL) として知られているテクニック。
namespace Edsl
{
// Stats represents parameters of the character.
// Stats can only be calculated by Effect.execute() method.
record Stats(string Name, int HP, int MP, int ATK, int DEF);
// Condition represents the condition of the game.
@takoeight0821
takoeight0821 / paddle.py
Created November 11, 2023 03:19
JoyConを振ってwキーを押すデモ(Python 3.11.6で動作)
import time
import pyautogui
from pyjoycon import device
from pyjoycon.joycon import JoyCon
# Set up JoyCon
id = device.get_L_id()
joycon = JoyCon(*id)
is_pressed = False
@takoeight0821
takoeight0821 / flake.nix
Created January 11, 2023 03:46
malgo-lang/malgo build script (Nix)
{
description = "malgo flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
@takoeight0821
takoeight0821 / Main.hs
Created March 10, 2022 13:44
センタイギアはおよそ128年間展開し続けられることを証明した。
#!/usr/bin/env stack
-- stack script --resolver lts-18.26
-- | 詳細は https://twitter.com/takoeight0821/status/1501899867249000448
module Main where
import Data.Foldable
import Data.IORef
import Data.List
import Data.List.HT
@takoeight0821
takoeight0821 / tundoku.md
Created March 7, 2022 14:28
読みたい積読一覧
@takoeight0821
takoeight0821 / Main.elm
Created January 28, 2022 12:40
Simple interactive animation. I created it to debug the system created in the assignment.
module Main exposing (..)
import Playground exposing (..)
cupWidth : number
cupWidth =
100
((N(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*S+N(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*WS(NS+NE(NS+NE(WE)*WS+WE)*WS+NE(NS+NE(WE)*WS+WE)*(E+NE(WE)*S)(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*WS)*NE(NS+NE(WE)*WS+WE)*(E+NE(WE)*S)(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*S+(W+N(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*S+N(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*WS(NS+NE(NS+NE(WE)*WS+WE)*WS+NE(NS+NE(WE)*WS+WE)*(E+NE(WE)*S)(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*WS)*(E+NE(NS+NE(WE)*WS+WE)*S+NE(NS+NE(WE)*WS+WE)*(E+NE(WE)*S)(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*S))(N(NS+NE(WE)*WS+WE)*S+N(NS+NE(WE)*WS+WE)*(E+NE(WE)*S)(N(WE)*S+(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*(E+NE(WE)*S))*(W+N(WE)*WS)(NS+NE(WE)*WS+WE)*S+(W+N(NS+NE(WE)*WS+WE)*WS+N(NS+NE(WE)*WS+WE)*(
@takoeight0821
takoeight0821 / main.md
Last active June 27, 2021 06:33
Malgo開発記録:型シノニムとimport

Malgo開発記録:型シノニムとimport

自己紹介

星にゃーん(@takoeight0821)です。 HaskellとかSF小説とかが好きです。

今日は自作言語Malgoの話をします。 https://github.com/malgo-lang/malgo