Skip to content

Instantly share code, notes, and snippets.

@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
@Rplus
Rplus / .gitignore
Last active Jan 1, 2018
Pokamon CP[2018-01]
View .gitignore
*.map
prepros-6.config
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>max CP by level Pokémons</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<h1 class="intro">Pokémons' CP calculator<small>vue version</small></h1>
@Rplus
Rplus / css-variables-width-x-height-area-1-2.markdown
Last active Nov 6, 2017
CSS Variables: width x height = area (1/2)
View css-variables-width-x-height-area-1-2.markdown
@Rplus
Rplus / Happy-CSSer-cover.html
Created Aug 25, 2017
Happy CSSer custom cover
View Happy-CSSer-cover.html
<html>
<head>
<style id="webmakerstyle">
.cover {
position: relative;
width: 1000px;
height: 524px;
margin: 0 auto;
@Rplus
Rplus / bling.js
Created Jul 12, 2017 — forked from paulirish/bling.js
bling dot js
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
View Spread Operator.md

Calling Functions without Apply

function doStuff (x, y, z) { }
var args = [0, 1, 2];
doStuff(...args);
function doStuff(x, y, z) {}

> var args = [0, 1, 2];