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
// 自分のKindleのメールアドレス (必ず変更すること) | |
KINDLE_MAIL_ADDRESS = "your_kindle_address@きんどる.com" | |
// Kindleへの送信を許可しているメールアドレス | |
KINDLE_PERMITTED_ADDRESS = "your_name <your_address@gmail.com>" | |
TEMP_DIR = "evernote_to_kindle" | |
ZIP_NAME = "evernote_to_kindle.zip" | |
app = Application.currentApplication() |
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
$filePath = "C:\ProgramData\Lenovo\Vantage\Addins\ThinkKBDAddin\*\LenovoVantage.CleanYourDevice.exe" | |
$acl = Get-Acl $filePath | |
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "Execute", "Deny") | |
$acl.SetAccessRule($rule) | |
Set-Acl -Path $filePath -AclObject $acl |
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 'csv' | |
require 'optparse' | |
# | |
# なるべく短い正規表現で住所を「都道府県/市区町村/それ以降」に分けるエクストリームスポーツ | |
# http://qiita.com/zakuroishikuro/items/066421bce820e3c73ce9 | |
# | |
# 正規表現で住所の「都道府県/市区町村/それ以降」をキャプチャできるか試すスクリプト | |
# 使い方はとりあえず実行すれば分かると思います | |
# |
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 'csv' | |
# 郵便局のサイトから郵便番号データをダウンロードしておく | |
# 同じフォルダ内のKEN_ALL.csvを読み込む | |
csv_path = File.expand_path("../KEN_ALL.CSV", __FILE__) | |
# 市区町村を取得 | |
cities = CSV.read(csv_path, encoding:"Shift_JIS:UTF-8").transpose[7].uniq | |
# 最後の文字以外に「市・区・町・村」があれば、その文字までの最長の文字列を取得 |
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
javascript: (()=>{ | |
const {hostname, pathname} = location; | |
let page = hostname + pathname; | |
let content = ""; | |
const now = new Date(); | |
const date = now.toLocaleDateString().replace(/\//g, "-"); | |
const time = now.toLocaleTimeString(); | |
content = `source:: [${document.title}](${location.href})\ncreated:: [[${date}]] ${time}`; |
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 tiktoken | |
import heapq | |
import re | |
ONLY_JAPANESE = True | |
CONTAINS_NON_SYMBOL = True | |
MODEL = "gpt-3.5-turbo" | |
#MODEL = "gpt-4" | |
enc = tiktoken.encoding_for_model(model) |
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
const defaultDict = <T>(defaultValue: T, object = {}): { [key: string]: T } => { | |
return new Proxy(object, { | |
get(obj, prop) { | |
return prop in obj ? obj[prop] : defaultValue; | |
}, | |
}); | |
}; | |
const dict = defaultDict(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
declare global {interface Object { log<T>(this: T, msg?): T }} // prettier-ignore | |
export function main(input: string): number | string { | |
const [A, B] = input.split(/\s/).map(Number); | |
return input; | |
} | |
// === ここから読む必要なし === | |
const DEBUG = process.env.NODE_ENV === "test"; | |
Object.assign(Object.prototype,{log<T>(this:T,msg="log"){if(DEBUG)console.log(`[${msg}] ${this}`);return this}}) // prettier-ignore |
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
Object.defineProperty(Object.prototype, "out", { | |
value() { | |
console.log(this.toString()); | |
return this; | |
}, | |
}); | |
interface Object { | |
out<T>(this: T): 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
Object.defineProperty(Object.prototype, "out", { | |
get() { | |
console.log(this.toString()); | |
return this; | |
}, | |
}); | |
interface Object { | |
get out(): any; // ここをanyじゃなくoutを呼んでいるインスタンスの型にしたい | |
} |
NewerOlder