In case you need to use Google Chrome internal favicons.
A note about suffixes:
@1x
means 16x16 icon size@2x
means 32x32 icon size
You'll have to copy/paste these paths.
import gzip | |
def gzip_search(query: str, candidate_chunks: list[str], top_k: int=1): | |
""" | |
文字列ベースで類似したテキストチャンクを推定するアルゴリズム. | |
`query`, `chunk`, および`query + " " + chunk`をそれぞれgzipで圧縮し、編集距離のようなものをベースに評価する. | |
Parameters: | |
query (str): 検索クエリとして使用する文字列. | |
top_k (int, optional): 返される類似チャンクの上位k個を指定する (default: 1). |
#!/bin/bash -ve | |
set -o pipefail | |
# EPUB ファイルをチャプター毎の mp4 ファイルに変換するシェルスクリプト | |
## 依存関係 | |
# brew install w3m が必要 | |
# unzip で、EPUBファイルからコンテンツ抽出 | |
# find, sort で、EPUBファイル内にあるXHTMLファイルをリストアップ | |
# w3m で、XHTMLファイルからHTMLタグを除去し txt に変換 | |
# say コマンドで txt から mp4 ファイルに変換 |
#import <Foundation/Foundation.h> | |
#import <assert.h> | |
//Compile with `clang -Os -framework Foundation -fno-objc-arc inlinestorage.m -o inline, run with `inline clever` or `inline naive` | |
/* | |
NaiveArray implements a simple immutable NSArray-like interface in probably the most obvious way: store a pointer to a C array of objects | |
*/ | |
@interface NaiveArray : NSObject { | |
NSUInteger count; |
// | |
// EXNOnDealloc.h | |
// | |
// Copyright (c) 2014 uasi. All rights reserved. | |
// | |
#import <libextobjc/metamacros.h> | |
#define onDeallocOfObject(object) \ | |
autoreleasepool {} \ |
import Foundation | |
enum PromiseState:Int { | |
case Incomplete = 0 | |
case Rejected = 1 | |
case Resolved = 2 | |
} | |
class Promise : Hashable { | |
BOOL isEqual(NSObject *a, NSObject *b) | |
{ | |
if (a) { | |
if (b) { | |
return [a isEqual:b]; | |
} | |
} else { // a == nil | |
if (!b) { | |
return YES; | |
} |
// 断片 | |
TcpClient tc = new TcpClient(); | |
tc.Connect("api.twitter.com", 80); | |
using (NetworkStream ns = tc.GetStream()) | |
{ | |
System.IO.StreamWriter sw = new System.IO.StreamWriter(ns); | |
System.IO.StreamReader sr = new System.IO.StreamReader(ns); |
// ==UserScript== | |
// @name Skip Gunosy Cushion Page | |
// @namespace userjs.com.cosmio.pastak | |
// @description | |
// @include http://gunosy.com/g/* | |
// ==/UserScript== | |
(function (){ | |
var link = document.querySelector('a.articles-show-click'); | |
location.href = link.href; |