Skip to content

Instantly share code, notes, and snippets.

View imWildCat's full-sized avatar

Mike Chong imWildCat

  • Canada
View GitHub Profile
@imWildCat
imWildCat / unstar_swift_repos.cts
Created December 13, 2023 19:46
Unstar old Swift repos (no update for one year and less than 1k stars)
import axios from 'axios';
const GITHUB_TOKEN = 'xxx';
const GITHUB_USERNAME = 'xxx';
axios.defaults.headers.common['Authorization'] = `token ${GITHUB_TOKEN}`;
const unstarRepo = async (repoFullName: string) => {
try {
await axios.delete(`https://api.github.com/user/starred/${repoFullName}`);
from langchain.llms.base import LLM
from typing import Optional, List
from revChatGPT.V1 import Chatbot
class revChatGPT(LLM):
chatbot: Chatbot = Chatbot(config={
"access_token": "<your token here>"
})
@imWildCat
imWildCat / repo-rinse.sh
Created August 3, 2023 22:55 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@imWildCat
imWildCat / user_script.js
Last active June 27, 2023 03:23
Fava checkmarks
for (const d of document.querySelectorAll('.change.num')) {
const c = document.createElement('input');
c.type = 'checkbox';
d.insertBefore(c, d.lastElementChild);
}
// credit: @upsuper
@imWildCat
imWildCat / reboot_to_windows.sh
Created March 25, 2023 14:55
Ubuntu 22.04: Reboot to Windows
# https://unix.stackexchange.com/a/112284
reboot_to_windows ()
{
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
sudo grub-reboot "$windows_title" && sudo reboot
}
alias reboot-to-windows='reboot_to_windows'
@imWildCat
imWildCat / safar_debug_simulator.applescript
Last active March 20, 2023 00:42
Open Safari and Debug Simulator (generated by GPT-4, refined by @imWildCat)
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Safari Dev or Simulator Debug (web)
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🤖
@imWildCat
imWildCat / chatgpt-4.md
Last active March 19, 2023 21:46
GPT-4: Converting Xcodegen yaml to Bazel demo

Convert this project.yml (XcodeGen) to Bazel build files:

name: Project
include: [environments.yml, AnotherProject/project.yml]
options:
  bundleIdPrefix: com.project
  usesTabs: false
  indentWidth: 2
  tabWidth: 2
@imWildCat
imWildCat / wireguard_setup_2023.md
Last active November 23, 2022 03:40
Set up site-to-site Wireguard (2023 version)
@imWildCat
imWildCat / .zshrc.local
Last active August 19, 2022 03:35
rc file
source ~/.rc.private
# rbenv
rbenv-init() {
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
eval "$(rbenv init -)"
}
pyenv-init() {
eval "$(pyenv init --path)"
@imWildCat
imWildCat / project_dot_npmrc
Created August 12, 2022 02:50
Sample npmrcs
registry=https://some.web.site.com/_packaging/[project-name]/npm/registry/
//some.web.site.com/_packaging/[project-name]/npm/registry/:always-auth=true
update-notifier=false
package-lock=false