Skip to content

Instantly share code, notes, and snippets.

View zag's full-sized avatar
🏠
Working from home

Alexandr Zahatski zag

🏠
Working from home
View GitHub Profile
@zag
zag / filterArraysRamda.md
Created August 3, 2018 08:13 — forked from cezarneaga/filterArraysRamda.md
Filter array of objects by nested values using ramda: Sometimes you dont have access to backend and you want to filter the response from an endpoint based on certain criteria. While trivial on flat arrays, this gets a bit tricky if the property you want to query is deeply nested. This is where Ramda shines.

Say we have a prop.users of the shape:

const users = [
    {username: 'bob', age: 30, tags: [{name: 'work', id: 1}, {name: 'boring', id: 2}]},
    {username: 'jim', age: 25, tags: [{name: 'home', id: 3}, {name: 'fun', id: 4}]},
    {username: 'jane', age: 30, tags: [{name: 'vacation', id: 5}, {name: 'fun', id: 4}]}
];
@zag
zag / fsm.kt
Created February 21, 2018 13:32
simple fsm
//
// +-----+
// | off |
// +-----+
// |
// v
// +--------+
// | red | <- +
// +--------+ /
// | /
@zag
zag / xvfb-cutycapt.pl
Created April 14, 2017 07:37 — forked from jnbek/xvfb-cutycapt.pl
My Perl Wrapper for Xvfb and CutyCapt
#!/usr/bin/perl -w
use strict;
use warnings;
use Getopt::Long;
use vars qw($url $out);
my $HOME = $ENV{'HOME'};
my $opt = GetOptions("url=s" => \$url,
"out=s" => \$out,
);
print "Preparing to thumbnail $url to $out\n";
@zag
zag / Opinion.md
Created March 25, 2016 12:48 — forked from ALF-er/Opinion.md
ReactJS Conf 2016

Disclaimer 1: Первую которая "про то чего мы достигли" я таки пропустил.

Disclaimer 2: Многие доклады смотрелись и отчёты писались в состоянии алкогольного опьянения.

Сейчас посмотрел Ben Alpert - What Lies Ahead она про то какие идеи они имеют о дальнейшем развитии. И они делят на UX-идеи и DX-идеи. В UX у них:

@zag
zag / mod_invites.js
Created February 14, 2012 07:06
invites
goog.provide('con.ui.mod_invites');
goog.require('soy');
goog.require('goog.events');
goog.require('con.tmpl.mod_invites');
//goog.require('goog.ui.Container');
goog.require('goog.ui.Component');
goog.require('zag.ui.Table');
goog.require('goog.net.XhrIo');
goog.require('goog.ui.Zippy');
goog.require('wbask.form');
@zag
zag / JavaCC JSON grammars definition.jj
Created November 14, 2011 09:13
JSON grammars for Perl 6 and for use with JavaCC
/*
* This software is licensed under the terms of the ISC License.
* (ISCL http://www.opensource.org/licenses/isc-license.txt
* It is functionally equivalent to the 2-clause BSD licence,
* with language "made unnecessary by the Berne convention" removed).
*
* Copyright (c) 2011, Mike Norman
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
---> Session started at: Wed, 02 Mar 2011 16:17:09 +0300
---> Checking for the latest package of 'ports-mgmt/portupgrade'
---> Found a package of 'ports-mgmt/portupgrade': /usr/ports/packages/All/portupgrade-2.4.8_1,2.tbz (portupgrade-2.4.8_1,2)
---> Upgrade of ports-mgmt/portupgrade started at: Wed, 02 Mar 2011 16:17:12 +0300
---> Upgrading 'portupgrade-2.4.3_2,2' to 'portupgrade-2.4.8_1,2' (ports-mgmt/portupgrade) using a package
---> Updating dependency info
---> Modifying /var/db/pkg/GeoIP-1.4.3/+CONTENTS
---> Modifying /var/db/pkg/ImageMagick-6.3.6.9/+CONTENTS
---> Modifying /var/db/pkg/OpenEXR-1.6.0/+CONTENTS
---> Modifying /var/db/pkg/aalib-1.4.r5_4/+CONTENTS