Skip to content

Instantly share code, notes, and snippets.

@art-solopov
art-solopov / LogicProcessor.java
Created August 3, 2020 13:04
Tinkering with Java forms & JRuby logic
package me.artsolopov.jrp;
import javax.swing.*;
import javax.swing.table.TableModel;
import javax.swing.text.JTextComponent;
public interface LogicProcessor {
void actionTrig(String inst, JTextComponent anno);
void actionClose();
void actionAddRow();
@art-solopov
art-solopov / ui_draw.lua
Created July 14, 2020 21:39
Basics of an UI drawing library
class = require('30log')
inspect = require('inspect')
local ui_draw = {}
local TILE_POSITIONS = {
left = 0, mid = 1, right = -1,
top = 0, mid = 1, bot = -1
}
@art-solopov
art-solopov / Main.elm
Created June 9, 2020 21:47
My first foray into Elm - a lap counter for timed races (format of N minutes + 1 lap to go)
module Main exposing (..)
import List exposing (range, map)
import Browser
import Html exposing (Html, button, div, text, input)
import Html.Attributes exposing (id, class, style, type_, value, step)
import Html.Events exposing (onInput)
-- MAIN
require 'securerandom'
require 'bundler'
Bundler.require(:default)
class RPCClient
def initialize
@var_store = {}
@connection = Bunny.new
start_connection!
@art-solopov
art-solopov / init.vim
Last active February 13, 2020 21:55
dotfiles
" Vim-plug
call plug#begin('~/.local/share/nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdTree'
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
@art-solopov
art-solopov / server.ex
Created September 13, 2019 18:19
Playing with Elixir supervisors
defmodule ElxSupPlay.Server do
use GenServer
def start_link({parent_sup, workers_count = 8}) do
GenServer.start_link(__MODULE__, {parent_sup, workers_count}, name: __MODULE__)
end
def report do
GenServer.call(__MODULE__, :report)
end
{
"custom-properties": {
"--color-primary-0": "#051845",
"--color-primary-1": "#05112B",
"--color-primary-2": "#041335",
"--color-primary-3": "#092568",
"--color-primary-4": "#0A328D",
"--color-secondary-1-0": "#200446",
"--color-secondary-1-1": "#16052C",
:root {
--color-primary-0: #051845;
--color-primary-1: #05112B;
--color-primary-2: #041335;
--color-primary-3: #092568;
--color-primary-4: #0A328D;
--color-primary-3-a20: #09256820;
--color-secondary-1-0: #200446;
@art-solopov
art-solopov / main.rs
Created November 8, 2018 11:34
Rust "widget" tree structure with parents refs
use std::rc::{Rc, Weak};
use std::borrow::Borrow;
use std::cell::RefCell;
#[derive(Debug, Copy, Clone)]
enum FontWeight {
Normal,
Thin,
Bold
}
@art-solopov
art-solopov / counter.js
Last active November 17, 2018 12:08
A small component using rxjs
import * as rxjs from 'rxjs'
import { map, scan, startWith, shareReplay, take, filter } from 'rxjs/operators'
import Mustache from 'mustache'
const TEMPLATE = require('raw-loader!./templates/counter.mustache')
Mustache.parse(TEMPLATE)
export default class Counter {
constructor () {