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
// ==UserScript== | |
// @name YouTube Comment Username Reveals | |
// @description add user name for comment | |
// @namespace https://htsign.hateblo.jp | |
// @version 0.3.7 | |
// @author htsign | |
// @match https://www.youtube.com/* | |
// @updateURL https://gist.github.com/htsign/14484659fa9224853835aeeae0cdbe10/raw/YouTube-Comment-Username-Reveals.user.js | |
// @downloadURL https://gist.github.com/htsign/14484659fa9224853835aeeae0cdbe10/raw/YouTube-Comment-Username-Reveals.user.js | |
// @grant none |
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
;; -*- mode: fundamental; coding: utf-8 -*- | |
;; Mathmatical Alphanumeric Symbols dictionary for SKK system | |
;; | |
;; https://www.asahi-net.or.jp/~ax2s-kmtn/ref/unicode/u1d400.html | |
;; | |
;; okuri-nasi entries | |
A /𝔸/ | |
B /𝔹/ | |
C /ℂ/ | |
D /𝔻/ |
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
// ==UserScript== | |
// @name Hatena bookmark compatibility for Bing | |
// @namespace https://htsign.hateblo.jp | |
// @version 0.0.3 | |
// @description add Hatebu images for Bing | |
// @author htsign | |
// @match https://www.bing.com/search?* | |
// @downloadURL https://gist.github.com/htsign/b2c913f28e4b8646d0b30c4170e7d34c/raw/hatebu-for-bing.user.js | |
// @updateURL https://gist.github.com/htsign/b2c913f28e4b8646d0b30c4170e7d34c/raw/hatebu-for-bing.user.js | |
// @grant none |
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
let string_of_list ~to_string xs = | |
"[" ^ String.concat "; " (List.map to_string xs) ^ "]" | |
let string_of_opt ~to_string = | |
function None -> "None" | Some x -> Printf.sprintf "Some(%s)" @@ to_string x | |
let () = | |
let print_optlist theme xs = | |
let xs = OptionList.to_optlist xs in | |
let lstr = string_of_list ~to_string:(string_of_opt ~to_string:string_of_int) xs in |
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
module List = struct | |
include Stdlib.List | |
let hd_opt xs = try Some (hd xs) with Failure _ -> None | |
end | |
let char_list_of_string string = | |
let rec aux acc idx = | |
if idx >= 0 then |
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
(* libraries definitions *) | |
(* Haskell's Data.Function.on implementation in OCaml *) | |
module Data : sig | |
module Function : sig | |
val on : ('b -> 'b -> 'c) -> ('a -> 'b) -> ('a -> 'a -> 'c) | |
end | |
end = struct | |
module Function = struct | |
let on bf f = fun x y -> bf (f x) (f y) |
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
module List = struct | |
include Stdlib.List | |
let group_by (projection : 'a -> 'key) (xs : 'a list) : ('key * 'a list) list = | |
let pairs = xs |> List.map (fun x -> projection x, x) in | |
let rec aux acc = function | |
| [] -> acc |> List.rev | |
| ((k, _) :: _) as xs -> | |
let ys, zs = xs |> List.partition (fun t -> fst t = k) in |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.Objects; | |
public class Pair<Left, Right> { | |
private static final List<Pair<?, ?>> cache = new ArrayList<>(); | |
public final Left left; | |
public final Right right; | |
private Pair(Left left, Right right) { |
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
// required: FSharp.Control.AsyncSeq | |
open FSharp.Control | |
open System.Diagnostics | |
open System.Drawing | |
open System.Windows.Forms | |
let inline initCollectionWithCtor< ^a, 'b, 'c when ^a : (member Add : 'b -> 'c)> items collection = | |
let add xs x = (^a : (member Add : 'b -> 'c) (xs, x)) | |
items |> List.fold (fun (xs : 'a) x -> add xs x |> ignore; xs) collection |
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
module MyArray : sig | |
type ('a, 'status) t | |
type regular | |
type sorted | |
val create : 'a array -> ('a, regular) t | |
val to_array : ('a, 'status) t -> 'a array | |
val sort : ?comparer:('a -> 'a -> int) -> ('a, regular) t -> ('a, sorted) t | |
end = struct | |
type ('a, 'status) t = Array of 'a array |
NewerOlder