Skip to content

Instantly share code, notes, and snippets.

View gioragutt's full-sized avatar

Giora Guttsait gioragutt

View GitHub Profile
@gioragutt
gioragutt / example.ts
Created June 5, 2021 18:07
I'm an RXJS Pleb please help
import { defer, NEVER, Subject, throwError } from "rxjs";
import {
bufferTime,
catchError,
filter,
mapTo,
mergeMap,
retry,
// tap,
} from "rxjs/operators";
@gioragutt
gioragutt / codefresh-example.yaml
Created May 9, 2021 19:59
Example of distributing a website with S3+CloudFront via CI
version: '1.0'
kind: pipeline
metadata:
name: my-website/publish
project: my-website
spec:
triggers:
- name: master_commit
@gioragutt
gioragutt / Formula.md
Last active April 8, 2021 07:55
Prep for circle border svg

Component Parameters

Name Calculation
Radius (RD) input (px)
Stroke (STR) input (px)
Normalized Radius (NRD) RD - STR * 2
Circumference (CIRC) NR * 2 * π
Border Part Percent (BPP) input
@gioragutt
gioragutt / __nodejs_lambda_layer
Last active January 8, 2021 14:22
Script for setting up layer for a lambda containing node.js dependencies
...
@gioragutt
gioragutt / links.md
Last active May 10, 2020 08:28
Tracing Links
@gioragutt
gioragutt / example1.ts
Created April 4, 2020 17:16
Examples discussion
class Component {
data$ = this.service.getData();
constructor(private service: Service) { }
}
class Component {
data$: Observable<Data>;
constructor(private service: Service) {
this.data$ = service.getData();
@gioragutt
gioragutt / autocomplete-example.ts
Last active August 19, 2022 18:15
RxJS Presentation
import { Observable, fromEvent } from 'rxjs';
import { ajax } from 'rxjs/ajax';
import { map, debounceTime, switchMap } from 'rxjs/operators';
function fetchSuggestions(text: string): Observable<string[]> {
return ajax.getJSON(`https://example.com/suggestions?query=${encodeURL(text)}`);
}
const input = document.querySelector('input');
const completions$ = fromEvent(input, 'keyup').pipe(
@gioragutt
gioragutt / hotjar.js
Last active November 1, 2019 20:11
Reverse engineered HotJar-iframe script, handles analytics action permission handling and passes actions to the parent site.
(function () {
function HtmlStorageWrapper(storage) {
return {
get: function (key) {
const valueFromStorage = JSON.parse(storage.getItem(key));
return !valueFromStorage || Date.parse(valueFromStorage.expires) <= (new Date).getTime()
? (storage.removeItem(key), null)
: valueFromStorage.value
},
set: function (key, value, expiresDate) {
@gioragutt
gioragutt / app.component.html
Last active August 19, 2019 12:20
Feature Loading
<ul>
<li *ngFor="let item of formEntries$ | async | keyvalue">
{{item.key}}
<ul>
<li *ngFor="let entry of item.value" (click)="pickedComponent = entry.component">
{{entry.name}}
</li>
</ul>
</li>
</ul>
@gioragutt
gioragutt / game.md
Last active November 24, 2018 20:43
ruven.properties

Concept

  • Real time combat
  • Team Game
  • Online - optional, with ability to private host
  • Deathmatch/Team Deathmatch support
  • Time based/ Goal based games. Not endless.

Game Features