Skip to content

Instantly share code, notes, and snippets.

@plastic041
plastic041 / index.ts
Created February 20, 2023 07:19
hono + socket.io
import { serve } from "https://deno.land/std@0.162.0/http/server.ts";
import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.ts";
import { Hono } from "https://deno.land/x/hono@v3.0.0/mod.ts";
import { logger, html } from "https://deno.land/x/hono@v3.0.0/middleware.ts";
const app = new Hono();
app.use("*", logger());
app.get("/", (c) => {
return c.html(
@plastic041
plastic041 / make-map.ts
Created February 15, 2023 13:22
minecraft
const COLS = 8; // x
const ROWS = 8; // y
/**
* Finds 8 neighbors(4 cardinal directions + 4 diagonal directions)
*/
function getNeighbors(x: number, y: number) {
const neighbors = [];
for (let i = -1; i <= 1; i++) {
@plastic041
plastic041 / main.dart
Created November 21, 2022 07:21
flutter pan to adjust opacity
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,

동사의 활용

  • る앞이 イ단: 상1단 활용(居る、起きる、着る)
  • る앞이 エ단: 하1단 활용(見える、受ける、混ぜる)
  • する、きる: 변격활용
  • 나머지, 예외(来る、する): 5단 활용
  • 즉 る가 아니면 모두 5단활용동사

활용형

@plastic041
plastic041 / bfsShortestDistance.ts
Created September 10, 2021 05:43
bfs shortest distance
const bfsDistance = (
array: number[][],
start: number[],
end: number[]
): number => {
const visited = new Set();
const queue: Point[] = [];
let distance = 0;
const startPoint: Point = { x: start[0], y: start[1] };
@plastic041
plastic041 / stackoverflow.css
Last active July 16, 2021 02:55
clean stackoverflow css
/* 좌우 필요없는 요소 제거 */
.top-bar,
.js-dismissable-hero,
.bottom-share-links,
#left-sidebar,
#sidebar,
#footer,
.ml12,
.post-form,
.js-post-menu,
@plastic041
plastic041 / README.md
Last active June 12, 2021 02:41
starting new vitejs project
  1. scaffold new vitejs project
  2. yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
  3. npx tailwindcss-cli@latest init
  4. tailwind.config.js -> purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}']
  5. yarn add -D eslint
  6. npx eslint --init
#!/usr/bin/env node
const execa = require('execa');
const path = require('path');
const yargs = require('yargs-parser');
const {name} = yargs(process.argv);
if (Boolean(name)) {
console.log('argv.name exists!');

yarn

yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint-config-airbnb-typescript eslint-config-react-app eslint-import-resolver-typescript eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks

.eslintrc.js

module.exports = {
  env: {
 browser: true,