Skip to content

Instantly share code, notes, and snippets.

View alankyshum's full-sized avatar

Alan Shum alankyshum

View GitHub Profile
@alankyshum
alankyshum / CantoneseSearcher.js
Last active October 30, 2020 20:35
TamperMonkey Scripts
/**
* 1. Install TamperMonkey
* 2. Configure a custom search engine in Chromium-based browser
* - https://humanum.arts.cuhk.edu.hk/Lexis/lexi-can/?q=%s
* 3. Save this script in TamperMonkey
* 4. When you load the page with https://humanum.arts.cuhk.edu.hk/Lexis/lexi-can/?q=機
* 5. The script will loop every second (until 10 sec) to check for the submission form
* 6. When the form is ready, it will submit the form with the word `機`
* 7. Then you will see the cantonese pronounciation from CUHK
*/
import Component from '@ember/component';
export default class extends Component {
}
@alankyshum
alankyshum / Visual Studio Code - Mac.xml
Last active August 11, 2021 03:29
Visual Studio Code (Mac) Keymap Settings for Android Studio/ Intellij
<keymap version="1" name="Visual Studio Code" parent="Visual Studio">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta c" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta x" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="meta v" />
</action>
@alankyshum
alankyshum / Finviz__ScreenerToMapView.user.js
Last active March 20, 2022 23:26
My own custom tampermonkey scripts
// ==UserScript==
// @name Finviz - Screener to map
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Render a button linking to a maps view of currently viewing stocks from screener page
// @author Alan Shum
// @match *://elite.finviz.com/screener.ashx*
// @icon https://www.google.com/s2/favicons?sz=64&domain=finviz.com
// @grant none
// ==/UserScript==
@alankyshum
alankyshum / README.md
Last active October 23, 2022 05:42
hammerspoon - with window management

Prerequisite

# Install basic tools (only needed for the first time)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install wget

# Install hammerspoon
brew install --cask hammerspoon
open /Applications/Hammerspoon.app
@alankyshum
alankyshum / components.foo\.js
Last active November 7, 2022 19:25
Inline Helper Test
import Component from '@glimmer/component';
import { helper } from '@ember/component/helper';
export default class extends Component {
selectedItems = ['apple', 'orange', 'pear'];
isItemSelected = helper(([targetItem]) => {
console.log(targetItem);
return this.selectedItems.includes(targetItem);
});