Skip to content

Instantly share code, notes, and snippets.

View vmasek's full-sized avatar
:shipit:
shipping it

Vojtech Mašek vmasek

:shipit:
shipping it
View GitHub Profile
@vmasek
vmasek / Ruby Notepad Bookmarklet
Created August 20, 2016 21:37 — forked from wilk/Ruby Notepad Bookmarklet
Javascript in-browser editor with CTRL+SHIFT+Y shortcut to execute the content. Just put it in your address bar and press enter. It works only on Chrome.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");addEventListener('keydown',function(evt){if(evt.ctrlKey && evt.shiftKey && evt.keyCode==89) eval(e.getSession().getValue());});</script>
@vmasek
vmasek / ReadMe.md
Created March 22, 2017 22:15
ALVAO drone road repair task

How to run

Task is implemented in Typescript, to transpile it to JS run tsc --target ES6 road-repair.ts, then it should be easily runnable like with nodejs like node road-repair.js

([,ᅠ,,,,ᅠᅠ]=[]+{},[ᅠᅠᅠ,ᅠ‌,ᅠᅠᅠᅠ,ᅠᅠ‌,,ᅠᅠᅠᅠᅠ,ᅠᅠᅠ‌,ᅠᅠᅠᅠᅠᅠ,,,ᅠᅠᅠᅠ‌]=[!!ᅠ]+!ᅠ+ᅠ.ᅠ)
[ᅠᅠ+=ᅠ+ᅠᅠᅠᅠ‌+ᅠᅠᅠᅠᅠᅠ+ᅠᅠᅠ+ᅠ‌+ᅠᅠᅠᅠ+ᅠᅠ+ᅠᅠᅠ+ᅠ+ᅠ‌][ᅠᅠ]
(ᅠᅠᅠᅠᅠ+ᅠᅠᅠ‌+ᅠᅠ‌+ᅠ‌+ᅠᅠᅠ+'`Invisible alert strikes again!`')``
title tags slideOptions
PWA
PWA, Angular, ngBeer
theme transition progress
simple
fade
true
@vmasek
vmasek / FlowUp_CLA.md
Created February 2, 2018 15:18
FlowUp CLA

FlowUp Software Grant and Corporate Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, FlowUp, s.r.o. ("FlowUp") must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of FlowUp and its users; it does not change your rights to use your own Contributions for any other purpose.

This version of the Agreement allows an entity (the "Corporation") to submit Contributions to FlowUp, to authorize Contributions submitted by its designated employees to FlowUp, and to grant copyright and patent licenses thereto.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to FlowUp. Except for the license granted herein to FlowUp and recipients of software distributed by FlowUp, You reserve all right, title, and i

@vmasek
vmasek / example.service.ts
Created February 19, 2018 15:12
example service
@Injectable()
export class ProductsService {
private readonly stuff$ = new ReplaySubject<Stuff[]>();
readonly stuff = this.stuff$.asObservable();
constructor(private readonly fire: Fire) {
this.fire.getTheStuff().subscribe(
(stuff) => this.stuff$.next(stuff)
@vmasek
vmasek / talk-on-api-client-generator.md
Last active September 18, 2018 14:07
Putting struggles with APIs to the REST

Putting struggles with APIs to the REST

A talk proposal for the ReactiveConf

In today's world where the GraphGL hype is on and a lot of developers are stuck with dust covered REST, I will present an easy and sustainable solution for making the classic REST API feel like you wish it has felt in TypeScript.

It starts by having the same data models at front-end and back-end, then continues with API client interface in form of service build on Angular HTTP client. Everything is typed and described in the way developer don't even need to study the API endpoints.

All you need to set it up is an up to date swagger file and Angular project.

How is your talk relevant to this audience?

@vmasek
vmasek / dummy.directive.ts
Last active July 24, 2018 08:04
Structural directives - Dummy directive
interface DummyContext {
/* ... */
}
@Directive({
selector: '[appDummy]'
})
export class DummyDirective {
@Input()
set appDummy(value: string) {
@vmasek
vmasek / let.directive.ts
Last active July 24, 2019 18:21
Structural directives - Let directive
/**
* This interface represents context of the directive.
*
* It defines two properties ($implicit and appLet) which enables same behavior with different syntax.
* It is not required to have both, it is just a way to provide support for both syntax.
*/
interface LetContext<T> {
/**
* Current item exposed in implicit value variable.
* This enables us to use the let syntax
@vmasek
vmasek / range.directive.ts
Last active July 24, 2019 18:20
Structural directives - Range directive
/**
* This interface represents context of the directive
*/
interface RangeContext {
$implicit: number; // current item exposed as implicit value, enables declaring in template variable via let keyword
index: number; // current index of the item
first: boolean; // indicates if the item is first in the collection
last: boolean; // indicates if the item is last in the collection
}