Skip to content

Instantly share code, notes, and snippets.

View foolgry's full-sized avatar
😜
I may be slow to respond.

Foolgry foolgry

😜
I may be slow to respond.
View GitHub Profile
@etrobot
etrobot / langgraph_control_browser.py
Created April 18, 2024 14:00
langgraph generates python script to control the existing chrome
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field
import json,urllib.request,websockets,asyncio
from typing import TypedDict, List
import textwrap,html
from bs4 import BeautifulSoup, Tag, NavigableString,Comment
import os
from dotenv import load_dotenv,find_dotenv
load_dotenv(find_dotenv())
@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 23, 2025 10:17
ChatPDF-zh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
alias jps ='jps -lvm'
alias jpsk9='jps | fzf --reverse -m -e -i | cut -d " " -f1 | xargs kill -9 2>/dev/null'
alias jpsk ='jps | fzf --reverse -m -e -i | cut -d " " -f1 | xargs kill 2>/dev/null'
@lilydjwg
lilydjwg / gh-check
Last active March 20, 2025 01:02
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
local function Chinese()
-- 简体拼音
hs.keycodes.currentSourceID("com.apple.inputmethod.SCIM.ITABC")
end
local function English()
-- ABC
hs.keycodes.currentSourceID("com.apple.keylayout.ABC")
end
@wilon
wilon / vim-surround使用指南.MD
Last active March 11, 2025 04:30
vim-surround使用指南,vim-surround如何使用

普通模式

命令 说明 + 示例
ds 删除括号
ds " "Hello world!" =>
Hello world!
cs 替换括号
cs "( "Hello world!" =>
(Hello world!)
cS 替换括号,括号内文本做新一行
cS "{ "Hello world!" => {     Hello world! }
@skunkbad
skunkbad / Tunnel.php
Created February 18, 2017 09:06
Attempt to use an SSH tunnel to connect to MySQL on a remote host
<?php
/***
Based off code from:
https://www.experts-exchange.com/questions/26619790/Connect-to-Mysql-through-PHP-ssh2-tunnel.html
Example usage: User/Pass Based Auth MySQL Proxy
-----------------------------------------------
$user_pass_config = array(
'user' => 'username',
'pass' => 'password',
@subfuzion
subfuzion / curl.md
Last active April 24, 2025 13:48
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@squarism
squarism / iterm2.md
Last active April 24, 2025 04:38
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@zchee
zchee / actionlist.vim
Last active April 14, 2025 23:20
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>