This file contains 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 requests | |
page_size = 50 | |
total = 205 | |
page = 1 | |
# It should be: `https://www.taichung.gov.tw/10026/Lpsimplelist?Page=1&PageSize=50&type=` | |
def get_api(page = 0, page_size = 0, total = 0): | |
return "https://www.taichung.gov.tw/10026/Lpsimplelist?Page=" + str(page) + "&PageSize=" + str(page_size) + "&type=" |
This file contains 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 TVT scripts | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description TV Tropes scripts | |
// @author iigmir | |
// @match https://tvtropes.org/**/* | |
// @icon https://assets.tvtropes.org/img/icons/favicon.ico | |
// @grant none | |
// ==/UserScript== |
This file contains 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 Total prices | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-05-19 | |
// @description Return the total price of your wishlist before yuo try to clean. | |
// @author You | |
// @match https://www.dlsite.com/**/mypage/wishlist | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=dlsite.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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 Ci-en Download images | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Download images on ci-en.dlsite.com | |
// @author You | |
// @match https://ci-en.dlsite.com/creator/**/article/** | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=dlsite.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>All work and no play makes Jack a dull boy</title> | |
</head> | |
<body> | |
<h1>All work and no play makes Jack a dull boy</h1> | |
<article id="all-work-and-no-play-makes-jack-a-dull-boy"> |
This file contains 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 { JSDOM } from "jsdom"; | |
import { writeFile, existsSync, mkdirSync } from "fs"; | |
/** | |
* Get HTML content. | |
* @param {String} url | |
* @returns {String} A HTML source code | |
*/ | |
const CrawlPage = async (url = "https://example.com") => { | |
const r = await fetch(url, { |
This file contains 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
version: "3.3" | |
services: | |
ldb: | |
image: "bitnami/mariadb:latest" | |
environment: | |
ALLOW_EMPTY_PASSWORD: yes | |
MARIADB_USER: "bn_myapp" | |
MARIADB_DATABASE: "bitnami_myapp" | |
networks: |
This file contains 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
const build_result_array = (input_array = [], current_length = 0, output_array = []) => { | |
const current = input_array[current_length - 1]; | |
if( current_length === 1 ) { | |
return [...output_array, `1 ${current}`]; | |
} | |
return build_result_array( | |
input_array, | |
current_length - 1, | |
[ | |
...output_array, |
This file contains 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
/** | |
* ha ha | |
* @see https://stackoverflow.com/a/549611/7162445 | |
* @param up Something is really wrong | |
*/ | |
const error_handling = (up) => { | |
if (up) { | |
console.error( up ); | |
throw up; | |
} |
This file contains 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
/** | |
* @param {Array} keys Array of keys. By definition from [RFC 4180](https://www.rfc-editor.org/rfc/rfc4180), it will be the first line of the file. | |
* @returns {Function} | |
*/ | |
const csv_array_to_json = (keys) => | |
{ | |
/** | |
* @param {Array} item Values | |
* @returns {Object} A JSON format interface. | |
*/ |
NewerOlder