This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::convert::TryInto; | |
use std::io; | |
use std::net::SocketAddr; | |
use std::sync::Arc; | |
use anyhow::{bail, Context}; | |
use bytes::{Buf, BufMut, BytesMut}; | |
use futures::stream::{self, Stream, TryStreamExt}; | |
use mime::Mime; | |
use mpart_async::server::MultipartStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### { | |
name: "どこからでもチャンネルに投稿するプラグイン" | |
version: "0.0.1" | |
author: "coord_e" | |
description: "どこからでもチャンネルに投稿したい...どこからでもチャンネルに投稿したくない?" | |
permissions: ["read:channels" "write:notes"] | |
} | |
@main() { | |
#channels = Mk:api("channels/followed" { limit: 100 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack --resolver lts-16.5 script --package mtl | |
{-# LANGUAGE NamedFieldPuns #-} | |
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Numeric.Natural ( Natural ) | |
import Data.List ( genericReplicate | |
, genericLength |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE NoStarIsType #-} | |
{-# LANGUAGE NoImplicitPrelude #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### { | |
name: "増やす" | |
version: "0.0.1" | |
author: "coord_e" | |
description: "増やせ!" | |
} | |
@parse_num_attr(text def) { | |
#arr = Str:split(text, " ") | |
? (Arr:len(arr) = 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### { | |
name: "回す" | |
version: "0.0.1" | |
author: "coord_e" | |
description: "回せ!" | |
} | |
@parse_num_attr(text def) { | |
#arr = Str:split(text, " ") | |
? (Arr:len(arr) = 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
shopt -s globstar | |
for file in **/*.html; do | |
curl -fsS "https://validator.w3.org/nu/?out=gnu" \ | |
-H "Content-Type: text/html; charset=utf-8" \ | |
--data-binary "@$file" \ | |
| { ! grep -z error; } | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env runghc | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack --resolver lts-16.5 script --package singletons | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
import Data.Functor ( void ) | |
import Data.Vector ( Vector, (!?), fromList ) | |
import qualified Data.Map.Strict as Map ( Map, lookup, insert, empty ) | |
import Control.Monad ( forever, unless ) | |
import Control.Monad.State.Strict ( MonadState, modify, get, put, evalStateT ) |
NewerOlder