Skip to content

Instantly share code, notes, and snippets.

View zxbodya's full-sized avatar

Bogdan Savluk zxbodya

  • Uber
  • Amsterdam, Netherlands
View GitHub Profile
@zxbodya
zxbodya / source-map-unpacker.js
Created June 8, 2015 23:28
script to extract sources, from sourcesContent field in sourcemap
'use strict';
var fs = require('fs');
var maps = [
fs.readFileSync('./main.xxxx.js.map'),
fs.readFileSync('./1.chunk.xxxx.js.map'),
fs.readFileSync('./2.chunk.xxxx.js.map'),
fs.readFileSync('./3.chunk.xxxx.js.map')
];
@zxbodya
zxbodya / render-react-with-rxjs.md
Last active November 1, 2021 08:49
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.

@zxbodya
zxbodya / how-to-implement-modal-in-angular.md
Last active August 29, 2015 14:12
How to implement modals in angular

How to implement modal in angular

Disclaimer: Originally this was answer on stackoverflow... Question was removed, so - answer was not published. But it is good as an example how to do modals or something like in angular

At first, take a look at ui-bootstrap modal implementation, it is a good example how modals can be implemented in angular.

Recently, I have some experience implementing my own modals for states in ui-router, my implementation was inspired by ui-bootstrap modal.

@zxbodya
zxbodya / lab.py
Last active August 29, 2015 14:06
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import deque
__author__ = 'z_bodya'
def readAutomata():
A = int(raw_input())
S = int(raw_input())
@zxbodya
zxbodya / S3-CORS-config.xml
Last active April 6, 2024 03:40
Client side uploads to s3, with pre-signed upload form (PHP/JS)
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>