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
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を呼んでいるインスタンスの型にしたい | |
} |
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 comp = (a, b) => +(a > b || (a < b && -1)); | |
[{ id: "a" }, { id: "c" }, { id: "b" }].sort((a, b) => comp(a.id, b.id)); | |
//=> [{ id: "a" }, { id: "b" }, { id: "c" }] |
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 [v12,v18] = [".v12", ".v18"].map(v=>document.querySelector(v).cellIndex); | |
const style = document.createElement("style"); | |
style.textContent = ` | |
th, td {display: none} | |
td:nth-child(1), | |
th:nth-child(${v12 + 1}), th:nth-child(${v18 + 1}), | |
td:nth-child(${v12 + 1}), td:nth-child(${v18 + 1}) | |
{ |
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
/** | |
* ましゅまろ1 物理現象グラフィックバトル | |
* https://products.sint.co.jp/hubfs/resource/topsic/pgb2021/1_1.pdf | |
* | |
* 入出力は適当 (文字列 or 数値) | |
*/ | |
// 前提条件 (実行しない) | |
function premise(input) { | |
const [x, y, k] = input.split(/\s+/).map(s => parseInt(s)); |
NewerOlder