Skip to content

Instantly share code, notes, and snippets.

View sheepla's full-sized avatar
🐑
メェ〜

sheepla sheepla

🐑
メェ〜
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Find Text from JSON</title>
</head>
<body>
<h1>Find Text from JSON</h1>
@sheepla
sheepla / App.tsx
Last active August 15, 2024 05:32
React + MUIによるダークモードに切り換え可能なUIの実装
import React from "react";
import "./App.css";
import LoginBox from "./components/LoginBox";
import {
createTheme,
CssBaseline,
ThemeProvider,
useMediaQuery,
} from "@mui/material";
import { deepPurple, indigo } from "@mui/material/colors";
@sheepla
sheepla / main.rs
Last active August 14, 2024 11:30
Nadenade Shikoshiko in Rust
fn main() {
println!(
"{}",
(["なで", "しこ"])
.iter()
.flat_map(|&s| std::iter::repeat(s).take(2))
.collect::<String>(),
);
}
@sheepla
sheepla / main.go
Last active August 13, 2024 12:07
Print raw SQL for debugging with uptrace/bun
package main
import (
"context"
"database/sql"
"fmt"
"log"
"github.com/uptrace/bun"
"github.com/uptrace/bun/dialect/sqlitedialect"
use futures::{
future::{BoxFuture, FutureExt},
task::{waker_ref, ArcWake},
};
use std::future::Future;
use std::pin::Pin;
use std::sync::{Arc, Mutex};
use std::task::{Context, Poll};
enum TsukijiShijoStatus {
@sheepla
sheepla / main.rs
Last active July 28, 2024 04:10
築地市場.rs
use std::time::Duration;
use std::sync::{Arc, Mutex};
use std::thread;
enum TsukijiShijoStatus {
Opening,
Closed,
}
impl ToString for TsukijiShijoStatus {
@sheepla
sheepla / main.rs
Created July 25, 2024 11:50
mpsc::channel example
use std::sync::mpsc;
use std::thread;
fn main() {
let (sender1, recceiver) = mpsc::channel();
let sender2 = mpsc::Sender::clone(&sender1);
let _ = thread::spawn(move || {
let data = vec!["One".to_string(), "Two".to_string(), "Three".to_string(), "Four".to_string()];
@sheepla
sheepla / parse_ts_ast.ts
Last active July 12, 2024 12:37
Parse TypeScript AST in Deno
import * as ts from "https://esm.sh/typescript";
interface BaseNode {
pos: number;
end: number;
kind: number;
id: number;
flags: number;
modifierFlagsCache: number;
transformFlags: number;
@sheepla
sheepla / shikanoko.fs
Last active June 28, 2024 12:21
🦌 しかのこのこのここしたんたん in F# 🔷
open System
type Pattern =
| Shika
| Noko
| Koshi
| Tan
member self.String() =
match self with
@sheepla
sheepla / shikanoko.rb
Last active June 28, 2024 11:43
🦌 しかのこのこのここしたんたん in Ruby 💎
puts [("しか" * 1), ("のこ" * 3), ("こし" * 1), ("たん" * 2)].join