Skip to content

Instantly share code, notes, and snippets.

View yottahmd's full-sized avatar

YotaHamada yottahmd

View GitHub Profile
Recreate Spacewar! as it was developed for the PDP-1 in 1962. Ensure that the design, effects, and features remain true to the original in every detail. Remember, every detail needs to be very identical as the original, including monitor, visual, look and feel, everything. The goal is to replicate so real Spacewar! that every developer believe it "original code running on PDP-1 emulator". Make it functional in a web browser.
@yottahmd
yottahmd / CloseAllVSCodeWIndows.AppleScript
Last active July 18, 2024 05:48
CloseAllVSCodeWIndows
use scripting additions
on run
set maxAttempts to 5
set attemptCount to 0
repeat
set attemptCount to attemptCount + 1
try
@yottahmd
yottahmd / cocoichi_20240226.csv
Last active February 26, 2024 07:08
ココイチ栄養成分一覧(値段は一部のみ、順次追加)
Menu/Topping Energy (kcal) Protein (g) Fat (g) Carbohydrates (g) Salt Equivalent (g) Price (JPY)
グランド・マザー・カレー 895 15.8 34.1 135.3 4.0 N/A
ローストチキンスープカレー 848 28.4 37.4 99.8 4.1 N/A
骨付きチキンスープカレー 800 26.9 32.8 102.4 4.5 N/A
ベジタブルスープカレー 768 13.7 28.8 117.7 3.5 N/A
ベーススープカレー 537 8.5 14.8 95.8 2.9 N/A
ローストチキン4個 311 19.9 22.6 4.0 1.2 N/A
かぼちゃと冬野菜カレー 778 13.8 19.8 141.4 3.3 N/A
手仕込チーズメンチカツカレー 1079 24.2 44.6 148.7 4.7 N/A
カキフライカレー 1033 20.1 39.8 153.3 4.5 N/A
@yottahmd
yottahmd / grokking_to_leetcode.md
Created March 14, 2023 13:29 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@yottahmd
yottahmd / example.yaml
Created May 18, 2022 10:35
Example DAG definition for Dagu
name: complex DAG3
steps:
- name: "Initialize"
command: "sleep 1"
- name: "Copy TAB_1"
description: "Extract data from TAB_1 to TAB_2"
command: "sleep 1"
depends:
- "Initialize"
- name: "Update TAB_2"
@yottahmd
yottahmd / RotatedRectangle.cs
Created December 5, 2021 02:16 — forked from jackmott/RotatedRectangle.cs
Rotated rectangle collision detection
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
//Faster linq-style convenience functions https://github.com/jackmott/LinqFaster
using JM.LinqFaster;
namespace DrawAndDrive
{
@yottahmd
yottahmd / keybindings.json
Created November 24, 2021 23:28
vscode setting to enable emacs key bindings in intergrated terminal
[
{
"key": "ctrl+e",
"command": "cursorLineEnd",
"when": "terminalFocus"
}
]
@yottahmd
yottahmd / Add.ts
Created November 18, 2021 03:52
Shitty add function in typescript
type Len<T extends any[]> = T["length"]
type _Add<
T,
N1 extends Number,
N2 extends Number,
Curr1 extends any[],
Curr2 extends any[]
> = Len<Curr1> extends N1
? Len<Curr2> extends N2
@yottahmd
yottahmd / Mermaid.tsx
Created August 19, 2021 01:43
Wrapper component for mermaid.js to use in React+TS
import React, { useEffect, useRef, useState } from "react";
import mermaidAPI from "mermaid";
type Props = {
divId: string;
children: string;
};
export default function Mermaid({ children }: Props) {
const [html, setHtml] = useState<string>("");
@yottahmd
yottahmd / setup-nodejs.sh
Last active May 10, 2019 04:31
Setup NodeJS Server Example
# Create Google Compute Engine Instance
$ gcloud deployment-manager deployments create app-server --config ./config/vm.yaml
# Connect to the instance
$ gcloud compute ssh app-server
# Create app-user
$ sudo adduser app-user
$ sudo usermod -a -G google-sudoers app-user