Skip to content

Instantly share code, notes, and snippets.

View yxy's full-sized avatar

BBB yxy

  • gggg
View GitHub Profile
@yxy
yxy / pymobx.py
Last active September 23, 2021 09:59
MobX reinvent in Python
# observable
# observer
# reaction
# derivation
import time
from typing import Callable
from collections import defaultdict
from attr import attrib, attrs
@yxy
yxy / data-binder.js
Created March 19, 2022 16:44
data-binder.js
(function () {
"use strict";
var view, viewModel, valueTemplate;
valueTemplate = {
configurable: false,
enumerable: true,
get: function () {
return this._value;
@yxy
yxy / app.js
Created May 18, 2022 05:32
A gist to generate last N repeated characters Tron account based on tronweb
// N x repeated characters
const LEN = process.argv.length > 2 ? parseInt(process.argv[2]) : 4
console.log('LEN: ' + LEN)
function check(s) {
let i = s.length - LEN
const p = s.charAt(i)
for (i++; i<s.length; i++) {
if (p != s.charAt(i)) {