Skip to content

Instantly share code, notes, and snippets.

View TakashiSasaki's full-sized avatar

Takashi SASAKI TakashiSasaki

View GitHub Profile
@TakashiSasaki
TakashiSasaki / mute-x-tweets-on-search.user.js
Last active April 25, 2024 04:15
Automatically hides tweets from a muted user in the search results on X (formerly Twitter) when 'u' is pressed.
// ==UserScript==
// @name Mute X Tweets on Search
// @namespace https://gist.githubusercontent.com/TakashiSasaki/89402d3b8c2896b161bf8add4295e150
// @version 2024-04-24.2
// @description Automatically hides tweets from a muted user in the search results on X (formerly Twitter) when 'u' is pressed.
// @author Takashi Sasaki
// @match https://twitter.com/search?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// @updateURL https://gist.githubusercontent.com/TakashiSasaki/89402d3b8c2896b161bf8add4295e150/raw/mute-x-tweets-on-search.user.js
// ==UserScript==
// @name Add Delete Button for Chat Conversations on Claude.ai
// @namespace https://moukaeritai.work/chatgpt-delete-button
// @version 0.4.20240326
// @description Add a delete button to easily remove chat conversations on Claude.ai.
// @author Takashi Sasaki
// @homepage https://twitter.com/TakashiSasaki
// @match https://claude.ai/chats
// @grant none
// @downloadURL https://gist.githubusercontent.com/TakashiSasaki/dac0b1778eaeabfb9dcfb04dd386070c/raw/userscript.js
HKEY_CLASSES_ROOT_20240316.txt
HKEY_CURRENT_CONFIG_20240316.txt
HKEY_CURRENT_USER_20240316.txt
HKEY_LOCAL_MACHINE_20240316.txt
HKEY_USERS_20240316.txt
# Get the current directory
$currentDirectory = Get-Location
# Output the current directory
Write-Output "Test"
Write-Output "Current Directory: $currentDirectory"
# Encode in UTF-8
$utf8Encoded = [System.Text.Encoding]::UTF8.GetBytes($currentDirectory)
# This file is saved in UTF-8 with BOM when uploading to Gist.
Write-Output "This file is saved in UTF-8 with BOM when uploading to Gist."
# But it is recommended to save in UTF-16 LE if possible.
Write-Output "But it is recommended to save in UTF-16 LE if possible."
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class WinAPI {
@TakashiSasaki
TakashiSasaki / enex2notion-error-log
Last active January 23, 2024 07:13
Error log when a file was too large to upload with enex2notion. The garbled text is due to the mingw terminal not understanding UTF-8, but it’s not a particular problem.
INFO: Uploading note 1169 out of 1243 '▒▒▒▒▒E▒_▒E▒▒▒▒▒[▒h --- ▒▒▒▒▒▒▒R▒▒▒▒▒Y ▒▒▒c▒@▒l▒}▒▒▒`▒▒▒f▒B▒A▒U▒▒▒Z▒▒▒^▒['
INFO: Uploading note 1170 out of 1243 '▒▒▒{▒▒`▒̏I▒▒'
WARNING: Failed to upload note '▒▒▒{▒▒`▒̏I▒▒' to Notion! Retrying...
WARNING: Failed to upload note '▒▒▒{▒▒`▒̏I▒▒' to Notion! Retrying...
WARNING: Failed to upload note '▒▒▒{▒▒`▒̏I▒▒' to Notion! Retrying...
WARNING: Failed to upload note '▒▒▒{▒▒`▒̏I▒▒' to Notion! Retrying...
ERROR: Failed to upload note '▒▒▒{▒▒`▒̏I▒▒' to Notion!
Traceback (most recent call last):
File "enex2notion\enex_uploader.py", line 20, in upload_note
File "enex2notion\enex_uploader.py", line 35, in _upload_note
@TakashiSasaki
TakashiSasaki / allow.txt
Last active January 20, 2024 04:46
DNS 許可リスト
mobile.pipe.aria.microsoft.com
browser.pipe.aria.microsoft.com
vortex.data.microsoft.com
device-metrics-us.amazon.com
s.youtube.com
collector.github.com
s.click.aliexpress.com
@TakashiSasaki
TakashiSasaki / ps-filter-by-name.ps1
Last active January 4, 2024 05:15
This PowerShell script prompts the user to enter a string that should match a part of a process's full path. It then filters all running processes to find ones where the executable path contains the provided substring. The script outputs a formatted table listing the process names, IDs, and their full executable paths that match the criteria. It…
$FilterString = Read-Host "Please enter a part of the process's full path"
$FilteredProcesses = Get-Process |
Where-Object { $_.MainModule -and ($_.MainModule.FileName -match $FilterString) } |
Select-Object Name, Id, @{Name="Path";Expression={$_.MainModule.FileName}}
$FilteredProcesses | Format-Table -AutoSize
Read-Host -Prompt "Press Enter to exit"
@TakashiSasaki
TakashiSasaki / settings.json
Created December 27, 2023 04:12
Default settings.jsoj of Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
#If VBA7 Then
Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hwnd As LongPtr, ByVal hdc As LongPtr) As Long
Declare PtrSafe Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As LongPtr, ByVal lpsz As String, ByVal cbString As Long, ByRef lpSize As SIZE) As Long
Declare PtrSafe Function SelectObject Lib "gdi32" (ByVal hdc As LongPtr, ByVal hObject As LongPtr) As LongPtr
Declare PtrSafe Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal H As Integer, ByVal W As Integer, ByVal E As Integer, ByVal O As Integer, ByVal FW As Integer, ByVal i As Integer, ByVal U As Integer, ByVal S As Integer, ByVal C As Integer, ByVal OP As Integer, ByVal CP As Integer, ByVal Q As Integer, ByVal PAF As Integer, ByVal F As String) As LongPtr
Declare PtrSafe Function DeleteObject Lib "gdi32" (ByVal hObject As LongPtr) As Long
#Else
Declare Function GetDC Lib "user32" (ByVal hwnd A