Skip to content

Instantly share code, notes, and snippets.

@Rplus
Rplus / gen_chars_order_from_arrays.js
Last active Mar 1, 2022
generate chars order from given array
View gen_chars_order_from_arrays.js
// Question from
// https://twitter.com/RplusTW/status/1498288300934971401
// inspired from @esp10mm
// want to get all order => [a, c, b, d]
genOrder([
['c', 'b'],
['a', 'b', 'd'],
['a', 'c'],
]);
@Rplus
Rplus / App.svelte.html
Created Feb 17, 2022
手動 keyin 補資料,剪貼簿圖像色相偏移
View App.svelte.html
<script>
import logo from './assets/svelte.png';
import data from './data.json';
let kwd = '變異';
let tier = 10;
let filled = false;
let pastedImgDataUrl;
// let imgFilter = 'w';
@Rplus
Rplus / README.md
Last active Dec 29, 2021
Orna RPG Strategies for monsters
@Rplus
Rplus / view_distance.js
Last active Dec 15, 2021
Orna GPS RPG view distance
View view_distance.js
/*
Orna RPG view distance formula:
1. base view distance: 180m
2. base factor per item: x1.2
3. base factor per adornment: x1.02
*/
// There are two methods to calculate with factor(1.2):
// Method 1: 180 * Math.pow(1.2, N)
// Method 2: 1.2 * D(N - 1)
@Rplus
Rplus / DateToJSONLocal.js
Created Feb 24, 2021
format local date with JSON format
View DateToJSONLocal.js
// https://stackoverflow.com/a/11172083
function toJSONLocal (date = new Date()) {
var local = new Date(date);
local.setMinutes(date.getMinutes() - date.getTimezoneOffset());
return local.toJSON().slice(0, 10);
}
@Rplus
Rplus / ReadMe.md
Last active Feb 8, 2021
巴哈姆特動畫瘋影片擷圖小工具
View ReadMe.md
@Rplus
Rplus / index.html
Last active Nov 6, 2018
check-position
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>+ position</title>
<script src="main.js" defer></script>
<style>
body {
@Rplus
Rplus / css-loader.css
Created Oct 20, 2018
CSS loader with Braille Patterns dots
View css-loader.css
@keyframes waiting {
0%, 100% { content: '⠇'; }
16% { content: '⠋'; }
32% { content: '⠙'; }
48% { content: '⠸'; }
64% { content: '⠴'; }
80% { content: '⠦'; }
}
View index.html
<script src="https://unpkg.com/react@15/dist/react.min.js"> </script><script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js">
</script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<div id="root"></div>
<script type="text/babel">
class Hello extends React.Component {
constructor(){
super();
@Rplus
Rplus / 撈卡提諾文章.js
Created Mar 26, 2018
壞小孩撈卡提諾文章…
View 撈卡提諾文章.js
let getUrl = (page) => `https://ck101.com/forum.php?mod=viewthread&tid=1762239&extra=&page=${page}`;
let toTxt = (d) => d.text();
let hr = '\n\n=====\n\n';
let getContent = (html) => {
let doc = document.implementation.createHTMLDocument();
doc.body.innerHTML = html;
return [...doc.querySelectorAll('.t_f')].map(i => i.textContent).join(hr);
};
let save = (page, text) => {
console.log(`save page ${page}`);