Skip to content

Instantly share code, notes, and snippets.

View windymelt's full-sized avatar
😄
Working from Home

Windymelt windymelt

😄
Working from Home
View GitHub Profile
//> using scala 3.3.0
//> using dep org.http4s::http4s-ember-server:0.23.23
//> using dep org.http4s::http4s-dsl:0.23.23
import cats.effect._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.ember.server._
// using scala "3.1"
@main def main(): Unit = {
println("Hello, Carbon!")
}

Keybase proof

I hereby claim:

  • I am windymelt on github.
  • I am windymelt (https://keybase.io/windymelt) on keybase.
  • I have a public key ASBznwbtc7D0PGz1blwHP6d8M61UE9jpekYp4eQ4DTz0dwo

To claim this, I am signing this object:

#!/usr/bin/env amm
import $ivy.`org.typelevel::cats-effect:3.3.14`
import cats.effect.{IO, IOApp, Resource, Ref}
import cats.effect.std.{Hotswap, Random}
import cats.implicits._
// トイレットペーパーのある一定の部分
case class PaperPiece(offset: Int) extends AnyVal
did:3:kjzl6cwe1jw146hn0jnkn20715xvrobe3wnl9sesq0hf8yntzd4j05g66gl3yz7
@windymelt
windymelt / naive-darr.rs
Created December 10, 2020 14:56
ナイーブなdouble array trieの実装
use std::collections::HashMap;
fn validate(
base: &Vec<Option<usize>>,
check: &Vec<Option<usize>>,
wdict: &HashMap<char, usize>,
s: &String,
) -> bool {
let ci = s.chars();
// initial offset is 0
@windymelt
windymelt / gist:80c71722d2c0aff3108c4aa17a7277bd
Last active August 19, 2020 03:42
はてブエントリページでユーザミュートをサポートする君
// ==UserScript==
// @name Mute user はてブ
// @namespace http://tampermonkey.net/
// @version 0.1
// @description mute user
// @author Windymelt
// @match https://b.hatena.ne.jp/*
// @grant none
// ==/UserScript==
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp(ql:quickload '(:iterate) :silent t)
)
@windymelt
windymelt / for-comprehension.lisp
Last active May 10, 2020 03:45
For comprehensionをCommon Lispで書く
(defmacro left (x)
`(multiple-value-bind (left) ,x left))
(defmacro right (x)
`(multiple-value-bind (_ right) ,x _ right))
(defmacro return-left (x)
`(values ,x nil))
(defmacro return-right (x)
@windymelt
windymelt / asd.lisp
Created January 14, 2020 09:39
provides package which links to all files under the named directory
;;; inside your ASD file
(in-package :cl-user)
(defpackage foo-asd
(:use :cl :asdf)
(:export :define-dependency-aggregator-package))
(in-package :foo-asd)
(ql:quickload :alexandria)
(defparameter *dependency-source-dir* (merge-pathnames #P"src/" (uiop:getcwd)))
(defun define-dependency-aggregator-package (name)