Skip to content

Instantly share code, notes, and snippets.

Avatar

INA Lintaro tarao

View GitHub Profile
@tarao
tarao / Example.scala
Last active Oct 7, 2021
Scala 3.0.2 ClassCastException
View Example.scala
object Example {
import scala.collection.IterableOps
import scala.language.implicitConversions
case class Cell[A](value: A)
object Cell {
implicit def toSeq[A, It[X] <: IterableOps[X, It, It[X]]](
cell: Cell[It[A]]
): Seq[A] = cell.value.to(Seq)
}
View README.md

OSS貢献を出力するワークフロー

  • issueを立てるとtarao/oss-contributionsを実行
    • issueタイトルにはfrom=YYYY-MM-DDto=YYYY-MM-DDを含むこと
    • issueのラベルにoss-contributionsをつけること
  • パラメータ
    • ORGANIZATION : ターゲットとなるOrganization
    • GITHUB_TOKEN : issueコメントをするためのトークン
    • OPEN_ACCESS_GITHUB_TOKEN : OSS貢献の情報を取得するためのトークン
      (内部情報引けないものが望ましい)
View hatena-contributions.all.md
View maven-diff-url.sh
#!/bin/sh
set -e
artifact="$1"
old="$2"
new="$3"
namespace="$(echo "$artifact" | cut -f 1 -d :)"
id="$(echo "$artifact" | cut -f 2 -d :)"
View index.js
var LambdaJS = require('./lambda');
var PrettyPrinter = {
pp: function(exp) {
return LambdaJS.Util.promote(exp).pp(this);
},
ppApp: function(app) {
return '(' + this.pp(app.fun) + ' ' + this.pp(app.arg) + ')';
},
ppAbs: function(abs) {
View genealogy.yaml
Lintaro Ina:
Masahiko Sato:
Satoru Takasu:
Shokichi Iyanaga:
Teiji Takagi:
David Hilbert:
C. L. Ferdinand (Carl Louis) Lindemann:
C. Felix (Christian) Klein:
Julius Plücker:
Christian Ludwig Gerling:
View Extensible.pm
package Class::Extensible;
use strict;
use warnings;
use Class::Load qw(load_class);
use Class::Mix qw(mix_class);
use List::MoreUtils qw(uniq);
my $Stash = '_EXTENDED_WITH';
@tarao
tarao / Instance.scala
Last active Feb 10, 2020
Category-theoretic universal product representation
View Instance.scala
import product2.|*|
package object instance {
implicit val instanceProduct2: universal.Product2[|*|] =
new universal.Product2[|*|] {
override def p1[A, B](p: A |*| B): A = product2.π1(p)
override def p2[A, B](p: A |*| B): B = product2.π2(p)
override def mediate[A, B, C](implicit
wedge: universal.Wedge[C, A, B]
View ensime.sbt
ensimeScalacOptions ++= List("-Ymacro-expand:normal")
View uim.rb
#!/usr/bin/env ruby
require 'fiddle/import'
require 'shellwords'
Libuim = `/sbin/ldconfig -p`.split(/[\r\n]/).map do |line|
line.strip.split(/\s+/)[0]
end.find do |line|
line =~ /\Alibuim[.]so[.][0-9]+\z/
end