Skip to content

Instantly share code, notes, and snippets.

View cannorin's full-sized avatar
🌐
WIRED

cannorin

🌐
WIRED
View GitHub Profile
@cannorin
cannorin / LongPressedEffect
Last active June 26, 2019 06:04
an example of using Effects with Fabulous to add a long pressed gesture
ref: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/effects/
getting started:
1. put LongPressedEffect.fs in the netstandard/shared project
2. put LongPressedEffect.{iOS,Android}.fs in the corresponding platform project
3. use the `create` callback to add an effect to Fabulous components (cf. Usage.fs)
license: MIT
(*
The MIT License
SpanUtils.fs - Useful extensions for Span
Copyright(c) 2019 cannorin
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:

Keybase proof

I hereby claim:

  • I am cannorin on github.
  • I am cannorin (https://keybase.io/cannorin) on keybase.
  • I have a public key whose fingerprint is 84B6 7F6C 065D 9A06 ABAC 20D3 B26B 2660 3BB2 B8DB

To claim this, I am signing this object:

@cannorin
cannorin / a.md
Last active April 1, 2018 15:00
FGO 複数の素材を集める際の効率ランキング

FGO 複数の素材を集める際の効率ランキング

最終更新: 2018年4月2日 0:00:08 (1時間ごとに更新)

算出方法

素材 X が最も多く出るクエストでの AP 効率を A_best(X) 、あるクエスト C での素材 X の AP 効率を A_C(X) とおくと、

クエスト C のお得度は、 C でドロップする可能性のあるそれぞれの素材 X に対して A_best(X) / A_C(X) (素材単体でのお得度) を計算して和を取ることで計算される。

Keybase proof

I hereby claim:

  • I am cannorin on github.
  • I am cannorin (https://keybase.io/cannorin) on keybase.
  • I have a public key whose fingerprint is 97B6 2212 5194 A0E9 9093 445F B6F2 B09D FFFB 97DE

To claim this, I am signing this object:

open System
open System.Collections.Generic
let memoize_rec (f : ('a -> 'b) -> 'a -> 'b) =
let m = Dictionary<'a, 'b> () in
let rec g x =
try
m.[x]
with
| :? KeyNotFoundException ->
@cannorin
cannorin / base4225.fs
Created January 6, 2016 08:08
Base4225
open System
open System.IO
open System.Text
open System.Collections.Generic
open System.Linq
let base64 = List.concat[['A'..'Z']; ['a'..'z']; ['0'..'9']; ['+'; '/'; '=']]
let b2u b1 b2 =
let i1 = List.findIndex ((=) b1) base64 in
// type <T> ... code of T
//
// <~<t>> -> <t>
// run <t> -> t
let hungry i =
let rec f i =
match i with
| 0 -> < () >
#!/bin/bash
[ $# -eq 0 ] &&
{
echo "Usage: pdf2minibook filename"
exit 0
}
[ -f $1 ] ||
{
echo "pdf2minibook: $1 not found"
@cannorin
cannorin / exehandler
Last active December 10, 2015 15:19
exe file handler for linux
#!/bin/bash
[ $# -eq 0 ] &&
{
echo "Usage: exehandler filename"
exit 0
}
[ -f $1 ] ||
{
echo exehandler: $1 not found