Skip to content

Instantly share code, notes, and snippets.

View rszeto's full-sized avatar

Ryan Szeto rszeto

View GitHub Profile
@rszeto
rszeto / khModded.js
Last active September 18, 2017 22:09
Katamari on your webpage!
/*
Copyright Alex Leone, David Nufer, David Truong, 2011-03-11. kathack.com
javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0);
*/
var BORDER_STYLE = "1px solid #bbb",
CSS_TRANSFORM = null,
CSS_TRANSFORM_ORIGIN = null,
POSSIBLE_TRANSFORM_PREFIXES = ['-webkit-', '-moz-', '-o-', '-ms-', ''],
@rszeto
rszeto / .xbindkeysrc
Created September 30, 2017 21:33
Mouse bindings for Logitech M705 on Ubuntu
# Scroll left --> Ctrl+Shift+Tab
"xte 'keydown Control_L' 'keydown Shift_L' 'key Tab' 'keyup Shift_L' 'keyup Control_L'"
b:6
# Scroll right --> Ctrl+Tab
"xte 'keydown Control_L' 'key Tab' 'keyup Control_L'"
b:7
# Bottom side button --> Alt+Tab
"xte 'keydown Alt_L' 'key Tab' 'usleep 100000' 'keyup Alt_L'"
@rszeto
rszeto / *pycharm-setup-2020.3.2.md
Last active October 26, 2024 12:55
Setting up PyCharm project with remote interpreter

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
@rszeto
rszeto / filter.txt
Last active May 29, 2020 04:23
AdBlock filters
!!!YouTube!!!
!Latest YouTube banner
youtube.com#?#ytd-rich-section-renderer:-abp-contains(Latest)
!Suggested videos (is it needed when annotations are disabled?)
!www.youtube.com##DIV[class="ytp-ce-element ytp-ce-video ytp-ce-top-left-quad ytp-ce-size-1280 ytp-ce-element-show"]
!www.youtube.com##DIV[class="ytp-ce-element ytp-ce-video ytp-ce-bottom-left-quad ytp-ce-size-1280 ytp-ce-element-show"]
!!!Engadget!!!
www.engadget.com##DIV[class="vdb_player "]
@rszeto
rszeto / convert_keep_to_notion.py
Last active March 16, 2021 07:17
Roughly converts Keep data from Google Takeout to Notion workspace manager. Some things can't be automated, like setting the Notion title or importing attachments. Notes with attachments are denoted with "***" and must be edited manually.
import json
import os
from pprint import pprint
KEEP_PATH = 'takeout-20200709T114934Z-001\\Takeout\\Keep'
NOTION_PATH = 'notion_export'
def main():
if not os.path.isdir(NOTION_PATH):
  1. Clone project to local: git clone <project URL>
  2. Create project root on remote: ssh <server> mkdir -p <remote project path>
  3. Create project root and environment on remote
    1. Copy environment.yml to remote
      cd <local project root>
      scp environment.yml <server>:<remote project path>
    2. Create environment on remote