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
class Rabbit | |
# Google Doodle 那隻兔子的解法,把 Ruby 安裝好後在命令列執行:ruby doodle_rabbit.rb | |
def initialize(stagename) | |
@stagename = "第 #{stagename} 關" | |
end | |
def intro(starting) | |
if( starting == true ) | |
puts "#{@stagename}解法:" | |
else | |
puts "#{@stagename}解法到此結束。" |
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 Block Quora Login screen | |
// @version 3 | |
// @grant none | |
// @match *://*.quora.com/* | |
// @author iigmir | |
// ==/UserScript== | |
/** | |
* The reason why Quora shows up the login popup after clicking a link is because of the referrer header. |
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. | |
*/ |
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
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
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
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
<!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
// ==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
// ==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== |
OlderNewer