Skip to content

Instantly share code, notes, and snippets.

// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@maciekkus
maciekkus / SketchSystems.spec
Last active January 8, 2019 12:58
ViewEditMachine &
ViewEditMachine &
wrapper
view
edit->edit
edit
cancel -> view
save -> saving
saving
success -> view
failure -> edit
@maciekkus
maciekkus / SketchSystems.spec
Last active January 8, 2019 14:40
LensTemplate &
LensTemplate &
Trial Lenses Availability
# automatically checks if trial lenses blisters are available for ordering
areAvailable?
available -> Available
not_available -> NotAvailable
Available
orderToCustomer -> Sent
orderToOptician -> Sent
Sent
view
# initial loading of data (if not available)
v_loading*
onDone -> v_idle
onError -> empty_or_error
# data is ready, just displaying things
v_idle
edit -> edit
reload -> v_loading
@maciekkus
maciekkus / SketchSystems.spec
Last active March 8, 2019 16:26
Service Machine
Service Machine
lenspass1&
trial mode
final mode
lenspass2&
trial mode 2
final mode 2
# State with nested states to proceed with fitting process.
Fitting Service
@maciekkus
maciekkus / SketchSystems.spec
Last active March 8, 2019 18:20
Fitting Service&
Fitting Service&
# state machine on service level (top layer)
# connected only to service_id
Internal service state machine
trial_lenspass_added -> In progress
service_stopped -> Ended without success
Just started*
In progress
@maciekkus
maciekkus / SketchSystems.spec
Last active November 14, 2019 13:15
Shop Login Machine
Shop Login Machine
NotLoggedIn*
CUSTOMER_ID_AND_HASH_PROVIDED -> ElviLoginCustomer
FIREBASE_AUTH -> ElviLoginCustomer
FIREBASE_EMAIL_LINK_REQUESTED -> WaitingForEmailLink
WaitingForEmailLink
TRY_AGAIN -> NotLoggedIn
ElviLoginCustomer
@maciekkus
maciekkus / machine.js
Last active November 14, 2019 12:59
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@maciekkus
maciekkus / SketchSystems.spec
Last active November 28, 2019 10:14
Login Machine
Login Machine
LoginScreenVisible
CUSTOMER_ID_AND_HASH_PROVIDED -> MagicHashLogin
FIREBASE_AUTH -> FirebaseLogin
FIREBASE_EMAIL_LINK_REQUESTED -> WaitingForEmailLink
WaitingForEmailLink
TRY_AGAIN -> LoginScreenVisible
FirebaseLogin