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: Issue about selecting SVG | |
description: Demo the issue about selecting SVG. | |
host: POWERPOINT | |
api_set: {} | |
script: | |
content: >+ | |
$("#run").click(() => tryCatch(run)); | |
const run: Function = async () => { |
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: Formulas for Word | |
description: Insert math equations into the online version of Word. | |
host: WORD | |
api_set: {} | |
script: | |
content: > | |
var editor; | |
const MathJax = window["MathJax"]; |
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
/** | |
* 1. Get current rates from https://www.xe.com/api/protected/midmarket-converter/ | |
* 2. Replace "rates" object with the correct currency rates. | |
* 3. Select a book on Kobo. | |
* 4. Click the country flag at the top right corner. | |
* 5. Execute this script. | |
*/ | |
rates = { | |
ADA: 3.8456167243, |
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
javascript: (() => { | |
/** | |
* This script is used to create the Google Calendar event links of the | |
* courses on the NTU "My Schedule" page. | |
*/ | |
if ( | |
location.href !== "https://nol.ntu.edu.tw/nol/coursesearch/myschedule.php" | |
) { | |
return; | |
} |
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
''' | |
WARNING: This model does NOT reflect the situation of the real world, and | |
I(the author) do NOT like to decide which policy the government should | |
implement based on accidents data. | |
''' | |
import sys | |
import random | |
if not sys.version_info.major == 3 and sys.version_info.minor >= 7: |
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
/** | |
* Usage: | |
* 1. Minify this script. | |
* 2. Rewrite minified script to `javascript:THE_MINIFIED_SCIPT`. | |
* 3. Add modified script to your bookmark. | |
* 4. Click it when you're at the Gmail page. | |
*/ | |
(async function () { | |
if (location.hostname != 'mail.google.com') return; |
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 csv | |
import json | |
import pathlib | |
import re | |
import sqlite3 | |
import sys | |
import urllib | |
from pprint import pprint | |
from bs4 import BeautifulSoup |
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
-- This exercise covers the first 6 chapters of "Learn You a Haskell for Great Good!" | |
-- Chapter 1 - http://learnyouahaskell.com/introduction | |
-- Chapter 2 - http://learnyouahaskell.com/starting-out | |
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses | |
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions | |
-- Chapter 5 - http://learnyouahaskell.com/recursion | |
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions | |
-- Download this file and then type ":l Chapter-1-6.hs" in GHCi to load this exercise |
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 inspect import getargspec, getfullargspec | |
def kwargs_only(a, b, c=3, d=4, **kwargs): | |
pass | |
def default_args(a, b, c=3, d=4, *args, **kwargs): | |
pass | |
def default_kwargs(a, b, *args, c=3, d=4, **kwargs): |
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 typing import Dict, List, Iterable, Hashable, Mapping, Sequence | |
def seq2lookup( | |
seqences: Iterable[Sequence], index: int, | |
) -> Dict[Hashable, Sequence]: | |
""" | |
Build the lookup table from a group of sequences. | |
The lookup table is used to quickly find the target sequence with the | |
corresponding item which is at the specific index of the target sequence. |