This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name BetterChatGPT | |
// @description Hopefully I can make ChatGPT look better! | |
// @version 0.1 | |
// @author JiashengWu | |
// @namespace https://chat.openai.com/ | |
// @match https://chat.openai.com* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com | |
// @grant GM_addStyle | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
[[ -n "${DEBUG}" ]] && set -x # `DEBUG=1 <cmd>` to debug this script | |
[[ -n "${DRYRUN}" ]] && DRYRUN=1 # `DRYRUN=1 <cmd>` to print the commands only | |
[[ -n "${VERBOSE}" ]] && VERBOSE=1 # `VERBOSE=1 <cmd>` to print more logs | |
function usage() { | |
exe=$(basename ${0}) | |
echo " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-16"> | |
<title>猜猜猜</title> | |
<style type="text/css"> | |
table { | |
width: 100%; | |
text-align: center; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
git clone https://github.com/wting/autojump.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/autojump && cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/autojump && ./install.py && cd - | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
if grep -q '^plugins=' ~/.zshrc \ | |
&& ! grep -q 'autojump' ~/.zshrc \ | |
&& ! grep -q 'zsh-autosuggestions' ~/.zshrc \ | |
&& ! grep -q 'zsh-syntax-highlighting' ~/.zshrc | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import argparse | |
import os | |
import re | |
import cv2 # pip install opencv-contrib-python | |
from vidstab import VidStab # https://github.com/AdamSpannbauer/python_video_stab | |
# Defaults | |
SRCFMT = 'jpeg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: SwitchSoundOutput | |
# Description: Switch sound output device | |
# Pre-reqs: brew install switchaudio-osx | |
set OUTPUT1 to "MacBook Pro Speakers" | |
set OUTPUT2 to "External Headphones" | |
set cmd to "/usr/local/bin/SwitchAudioSource -t output " | |
set curr_output to do shell script cmd & "-c" | |
if curr_output is equal to OUTPUT1 then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import os | |
import re | |
from PIL import Image | |
# Defaults | |
SRCFMT = 'jpeg' | |
OUTPUT = 'output' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Comparator; | |
public class arr2idx { | |
public static void main(String[] args) { | |
int[] arr = new int[]{10, 8, 0, 5, 3}; | |
System.out.println(Arrays.toString(arr)); // [10, 8, 0, 5, 3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from pytz import timezone | |
yyyy, mm, dd = 2018, 11, 22 | |
tz = timezone('US/Pacific') | |
# init dates and get timestamp diff by millisecond | |
date = datetime(yyyy, mm, dd, tzinfo=tz) | |
base = datetime(2011, 8, 24, tzinfo=timezone('US/Pacific')) | |
diff = int(date.timestamp() - base.timestamp()) * 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from bs4 import BeautifulSoup | |
# fetch html doc of our wines page (which contains all wines) | |
our_wines_url = 'https://stellarosawines.com/our-wines/' | |
html_doc = requests.get(our_wines_url).text | |
soup = BeautifulSoup(html_doc, 'html.parser') | |
# print(soup.prettify()) |
NewerOlder