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 / SassMeister-input.scss
Created Jan 12, 2016
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.3.2)
// ----
@function nth-selector($str, $n) {
@for $i from 1 through $n {
@if (str_index($str, ' ')) {
@if $i == $n {
$str: str_slice($str, 0, str_index($str, ' ') - 1);
} @else {
@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 / a-Facebook-emoji-list.html
Last active Jul 1, 2020
Facebook-emoji-list lookup
View a-Facebook-emoji-list.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Facebook emoji list</title>
<style>
body {
text-align: center;
}
@Rplus
Rplus / mouse.ahk
Last active Nov 19, 2018
my personal autohotkey script
View mouse.ahk
; new mouse: microsoft comfort 6000,
; custom side-button behavior by autohotkey,
; => helpful for browser webpage (FB/blog/news)
XButton1::Send {PgDn}
XButton2::Send {PgUp}
~LButton & XButton2::Send {Home}
~LButton & XButton1::Send {End}
@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 {