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
import { Octokit } from 'octokit'; | |
const { rest: github } = new Octokit(); | |
const OWNER = 'makenowjust-labs'; | |
const REPO = 'recheck'; | |
const BRANCH = 'main'; | |
const STATUS = 'success'; | |
const WORKFLOW_ID = 'main.yml'; | |
const PER_PAGE = 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
require "benchmark" | |
require "rexml/document" | |
n = 10000 | |
xml = REXML::Document.new(<<~XML) | |
<?xml version="1.0" encoding="UTF-8"?> | |
<breakfast_menu> | |
<food> |
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
// An implementation of Glushkov's construction in Scala. | |
// | |
// See https://en.wikipedia.org/wiki/Glushkov%27s_construction_algorithm. | |
/** Nfa represents an non-deterministic finite state automaton. | |
* | |
* @tparam A | |
* an alphabet type | |
* @tparam Q | |
* a state type |
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
// https://hackage.haskell.org/package/data-reify | |
import java.util.IdentityHashMap | |
trait MuRef[T]: | |
type F[_] | |
def recurse[U](t: T)(f: T => U): F[U] | |
trait NuRef[T]: |
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
trait Semigroup[A]: | |
def combine(x: A, y: A): A | |
trait Monoid[A] extends Semigroup[A]: | |
def empty: A | |
trait Functor[F[_]]: | |
def map[A, B](fa: F[A])(f: A => B): F[B] | |
trait Applicative[F[_]] extends Functor[F]: |
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
package rbtree | |
import scala.annotation.tailrec | |
// References: | |
// - https://abhiroop.github.io/Haskell-Red-Black-Tree/ | |
// - https://github.com/Abhiroop/okasaki/blob/b4e8b6261cf9c44b7b273116be3da6efde76232d/src/RedBlackTree.hs | |
enum Color: | |
case R, B |
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
# The MIT License | |
# | |
# Copyright 2023 Hiroya Fujinami (a.k.a. TSUYUSATO "MakeNowJust" Kitsune) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the “Software”), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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
require 'fileutils' | |
UNICODE_VERSION = "15.0.0" | |
BASE_DIR = "#{__dir__}/#{UNICODE_VERSION}" | |
UCD_DIR = "#{BASE_DIR}/ucd" | |
BASE_URL = "https://www.unicode.org/Public/#{UNICODE_VERSION}/ucd" | |
def download_file(file) | |
dir = "#{BASE_DIR}/#{File.dirname(file)}" | |
FileUtils.mkdir_p(dir) |
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 ruby | |
module Emmental | |
class Error < StandardError | |
STACK_UNDERFLOW = 'Stack Underflow' | |
QUEUE_UNDERFLOW = 'Queue Underflow' | |
end | |
class State | |
def initialize |
This file has been truncated, but you can view the full file.
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 strict"; | |
var __defProp = Object.defineProperty; | |
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
var __getOwnPropNames = Object.getOwnPropertyNames; | |
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
var __hasOwnProp = Object.prototype.hasOwnProperty; | |
var __propIsEnum = Object.prototype.propertyIsEnumerable; | |
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | |
var __spreadValues = (a, b) => { | |
for (var prop in b || (b = {})) |
NewerOlder