Skip to content

Instantly share code, notes, and snippets.

@Rplus
Rplus / view_distance.js
Created Jul 30, 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}`);
View utils.js
// getDeepProp({a: {b: 3}}, 'a.b') => 3
export function getDeepProp(obj, deepProp, splitChar = '.') {
return deepProp.split(splitChar).reduce((_obj, _deepProp) => _obj && _obj[_deepProp], obj);
}
View wecatch-auto-refresh.js
window.log = {};
const timeInterval = 5.5; // minute(s)
const filters = {
'/B/': 'iv80+',
'/G/': 'iv90+',
'/W/': 'iv0',
'/R/': 'iv100',
'/349.': '醜醜魚',
};
var checkGoodItems = () => {
View 01) Happy CSSer - 1.md