Skip to content

Instantly share code, notes, and snippets.

View superkeyor's full-sized avatar

Keyor superkeyor

View GitHub Profile
@segfault-bilibili
segfault-bilibili / clash-naiveproxy.yaml
Last active March 1, 2024 02:32
Clash config which makes use of naiveproxy
# 这个配置可以让Clash将naiveproxy作为上游代理,尤其是可以利用它的tun模式方便地实现全局透明代理
# 但很显然,必须额外跑一个naiveproxy客户端,不能做到简单拖动Clash配置后立即可用
# 注意:务必按下述示例把naiveproxy服务器的IPv4/v6地址以及域名加入直连规则
mixed-port: 7890
allow-lan: false
bind-address: '127.0.0.1'
mode: rule
log-level: info
external-controller: '127.0.0.1:9090'
dns:
@vrtmrz
vrtmrz / deploy_couchdb_to_flyio.ipynb
Last active May 18, 2023 08:56
deploy_couchdb_to_flyio.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samhenrigold
samhenrigold / medium-to-scribe.js
Last active September 15, 2023 19:29
UserScript to redirect medium.com articles to scribe.rip
// ==UserScript==
// @name Medium to Scribe
// @description Redirects Medium.com articles to scribe.rip
// @match *://*/*
// @exclude /^https?://(www\.)?medium\.com/((\?.*)|((m|about|creators|membership)/.*))$/
// @run-at document-end
// @version 1.2.4
// @updateURL https://gist.githubusercontent.com/samhenrigold/4a082dde823bc3cb62e43a2fc2b12b8e/raw/medium-to-scribe.js
// ==/UserScript==
@plembo
plembo / pandocdocx2md.md
Last active May 29, 2024 15:39
Convert docx to markdown with pandoc

Convert Word documents to markdown with pandoc

I use pandoc to convert masses of Word documents to markdown. Still working on a generic script, but for now here's the "gist" of what I type into the terminal:

$ myfilename="example"
$ pandoc \
-t markdown_strict \
--extract-media='./attachments/$myfilename' \
$myfilename.docx \
import requests
import json
import alpaca_trade_api
tickers_list = []
with open('tickers.txt', 'r+') as tickers_file:
tickers_list = tickers_file.read().splitlines()
tenquant_key = 'FAKE_KEY'
@marksharrison
marksharrison / .stglobalignore
Created September 3, 2019 10:00
Syncthing global ignore file
// .stglobalignore
// Syncthing Ignore Patterns - https://docs.syncthing.net/users/ignoring.html#patterns:
// Useful .stignore Patterns - https://goo.gl/DVHI1h
// Usage: Add the line below to all .stignore files for each Syncthing node
// #include .stglobalignore
// Incomplete Downloads
// Firefox downloads
*.part
@yetone
yetone / karabiner.json
Last active September 6, 2021 05:02
Karabiner 通过 left shift 来切换中英文
{
"description": "Switch between zh-Hans <-> en (left_shift)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"language": "en"
}
tell application "Bookends"
set theIDs to «event ToySRUID» "Selection"
repeat with theID in paragraphs of theIDs
tell front library window
try
set myRefs to (publication items whose id is theID)
set myItem to first item of myRefs
set thePath to path of attachment items of myItem
@snowkidind
snowkidind / README.md
Last active November 11, 2021 16:53
TDAmeritrade API Notes for Node.js

Access to Ameritrade API

notes that may be helpful for node.js devs

What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...

Making an app

On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to https://www.uuidgenerator.net/ and just grabbed the firs

@zverhope
zverhope / be_orphaned_files.scpt
Last active December 16, 2022 08:24
Find orphaned files in Bookends, whether with hierarchical or flat folder structure, and then move to Orphans folder
set theFolder to (path to home folder as text) & "Library:Mobile Documents:iCloud~com~sonnysoftware~bot:Documents"
set BEList to {}
set orphanList to {}
set FinderList to {}
set pathList to {}
set od to AppleScript's text item delimiters
tell application "Finder"
-- create a list of the name of every file in the folder you've set
set FinderList to every file of folder theFolder as alias list