Skip to content

Instantly share code, notes, and snippets.

@jiyee
jiyee / workaround.md
Created October 25, 2024 03:03 — forked from Diogo-Rossi/workaround.md
Workaround to make a VSCode settings sync to a regular GitHub repository

Requirements:

  • git
  • python
  • code (cli of VSCode)

All reachable from the PATH of the system

Steps: (9 steps)

  1. Using the portable version of VS Code, there is a /data/ folder in the software's directory
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@jiyee
jiyee / gist:18b47304536acab13f4636f9fc3c61bd
Created September 14, 2024 04:05
.obsidian.markdown-helper.js
// https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts
// parameters: editor, view, selection
function jumpHeading(isForward) {
let cursor = editor.getCursor();
let line = cursor.line;
do {
line += isForward ? 1 : -1;
if (line < 0 && !isForward) {
line = editor.lineCount();
@jiyee
jiyee / chunking-regex.ts
Created August 15, 2024 12:41 — forked from hanxiao/testRegex.js
Use regex to do chunking by using all semantic cues
// Used in https://jina.ai/tokenizer (Aug. 14th version)
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 6;
const MAX_HEADING_CONTENT_LENGTH = 200;
const MAX_HEADING_UNDERLINE_LENGTH = 200;
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100;
const MAX_LIST_ITEM_LENGTH = 200;
const MAX_NESTED_LIST_ITEMS = 5;
const MAX_LIST_INDENT_SPACES = 7;
const MAX_BLOCKQUOTE_LINE_LENGTH = 200;
/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
'use strict';
var obsidian = require('obsidian');
var child_process = require('child_process');
var util = require('util');
""""""""""""""""""""""
" Leader
""""""""""""""""""""""
" let mapleader=,
" can't set leaders in Obsidian vim, so the key just has to be used consistently.
" However, it needs to be unmapped, to not trigger default behavior: https://github.com/esm7/obsidian-vimrc-support#some-help-with-binding-space-chords-doom-and-spacemacs-fans
unmap ,
" map ; to : in normal mode, so that I don’t rely on the shift key
" nmap ; :
@jiyee
jiyee / Z-removekebab.sh
Created March 19, 2022 10:07 — forked from Ambroos/WARNING.md
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...
launchctl remove com.sentinelone.sentineld-helper
launchctl remove com.sentinelone.sentineld-updater
launchctl remove com.sentinelone.sentineld
launchctl remove com.sentinelone.sentineld-guard
killall SentinelAgent
rm -rf /Library/Extensions/Sentinel.kext
rm -rf /Library/Extensions/Sentinel.kext/Contents
rm -rf /Library/Extensions/Sentinel.kext/Contents/Info.plist
@jiyee
jiyee / cVim.css
Created August 15, 2017 07:41
cVim stylesheets
#cVim-link-container, .cVim-link-hint, #cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results, .cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left, .cVim-completion-item .cVim-right, #cVim-hud, #cVim-status-bar {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, Arial;
font-size: 9pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-link-container {
position: absolute;
pointer-events: none;
width: 100%; left: 0;
@jiyee
jiyee / xcode-build-bump.sh
Created February 10, 2016 13:23 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@jiyee
jiyee / cvim.rc
Last active April 13, 2017 06:56
cvim Options
set typelinkhints
let previousmatchpattern = "((?!last)(prev(ious)?|back|«|less|<|‹|.*上一页|返回)+)"
let nextmatchpattern = "((?!first)(next|more|>|›|»|forward|下一页.*)+)"
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*"]
let searchengine baidu = "https://www.baidu.com/s?wd=%s"
let completionengines = ["google", "baidu"]
let searchalias g = "google"
let searchalias b = "baidu"