Skip to content

Instantly share code, notes, and snippets.

View Guria's full-sized avatar

Aleksei Gurianov Guria

View GitHub Profile
@Guria
Guria / reatom-extensibility-article.md
Last active December 11, 2025 13:44
reatom extensibility article

Reatom's Extensibility in Action: Build for Your Custom Needs

Reatom v1000 just left alpha with a bold promise — "state management that grows with you." But what does that actually mean when you hit the edge cases that every real application eventually encounters?

Many developers, including myself, started using Reatom during the alpha stage because it was already delivering significant value in production. The patterns I'll show you here aren't theoretical — they've been battle-tested in real projects. If you haven't seen the introductory article, it covers the basics well. This article goes deeper: we'll explore how Reatom's extensibility lets you bend the library to your domain instead of the other way around.

The core thesis is simple: Reatom's power comes from a small set of primitives — atom, action, computed, effect, and extensions — that you can override, hook into, and compose for your specific needs. Let's see wha

{
"name": "Pharmacy Mapping Rules",
"presets": [
{
"name": "Pharmacy",
"geometry": ["point", "area"],
"primary": [
{
"key": "amenity",
"val": "pharmacy"
@Guria
Guria / README.md
Created June 12, 2023 13:41
Bash script for Manual Installation of GNOME Extension from ZIP File

GNOME Extension Installer Script

This bash script allows you to manually install GNOME extensions from a ZIP file. It's a helpful tool for installing GNOME extensions from local files rather than using GNOME Extensions or other online sources.

Usage

  1. Save the install_gnome_extension.sh script to your local machine.

  2. Make the script executable:

%%private(let keyStringifyRegexp = %re("/([=:@$/])/g"))
%%private(let valueStringifyRegexp = %re("/([&;/])/g"))
%%private(let keyParseRegexp = %re("/[=:@$]/"))
%%private(let valueParseRegexp = %re("/[&;]/"))
%%private(
let encodeString = (str, regexp) =>
Js.Global.encodeURI(Js.String2.replaceByRe(str, regexp, "/$1"))
)
<!DOCTYPE html>
<html
lang="en"
xmlns="http://www.w3.org/1999/xhtml"
prefix="og: http://ogp.me/ns# fb: http://www.facebook.com/2008/fbml"
>
<head>
<meta http-equiv="refresh" content="2;url=https://bb-ui.dev.sg.salondev.net/review/08d7bd31-a7da-46e8-b63a-b47a434e09c0" />
<!-- Facebook Open Graph meta tags
documentation: https://developers.facebook.com/docs/sharing/opengraph -->
@Guria
Guria / use-hover-example.js
Last active October 30, 2018 16:31 — forked from gragland/use-hover-example.js
React Hook recipe from https://usehooks.com
import { useRef, useState, useEffect } from 'react';
// Usage
function App() {
const [ref, isHovered] = useHover(ref);
return (
<div ref={ref}>
{isHovered ? '😁' : '☹️'}
</div>
const REVISIT_PENALTY = 1.5
const DEADEND_PENALTY = 100000
const directions = ['left', 'right', 'up', 'down']
const visitedScore = {}
const getNextCoords = (x, y) => ({ left: [x-1, y], right: [x+1, y], up: [x, y-1], down: [x, y+1] })
const getScore = (x, y) => visitedScore[`${x}:${y}`] || 0
const increaseScore = (x, y, n = 1) => visitedScore[`${x}:${y}`] = getScore(x, y) * REVISIT_PENALTY + n
function strategy(move, canMove, x, y, maze) {
const nextCoords = getNextCoords(x, y)
// Define state and state updates
function ReduxState (state = Immutable.fromJS({items: []}), action) {
  switch (actions.type) {
    case 'addItem':
      return state.push('items', action.item)
  }

  return state
}
@Guria
Guria / dabblet.css
Created September 19, 2016 19:04
HTML5 / CSS3 Circle with Partial Border
/**
* HTML5 / CSS3 Circle with Partial Border
* http://stackoverflow.com/q/13059190/1397351
*/
* { margin: 0; padding: 0; }
.circle {
position: relative;
margin: 7em auto;
width: 16em; height: 16em;
border-radius: 50%;
@Guria
Guria / cerebral-cli.js
Last active July 13, 2016 13:43
cerebral-view-inquirer :)
import controller from './controller.js'
import {Computed} from 'cerebral'
import {set, copy} from 'cerebral/operators'
import inquirer from 'inquirer'
controller.addSignals({
pageChanged: [ copy('input:page', 'state:page') ],
scaffoldSelected: [
() => console.log('scaffold'),
() => { /* services.scaffold(options) */ },