Skip to content

Instantly share code, notes, and snippets.

View gioragutt's full-sized avatar

Giora Guttsait gioragutt

View GitHub Profile
@gioragutt
gioragutt / bootstrap.sh
Last active February 7, 2018 16:20
initialize mongo with replication set
DEFAULT_VOLUME_PATH=~/mongo/data
CONTAINER_NAME=some-mongo
runMongoContainer()
{
VOLUME=$1
docker run --name $CONTAINER_NAME -v $VOLUME:/data/bs -p 27017:27017 -d mongo --replSet rs0
####################################################################### NOTICE --replSet
}
@gioragutt
gioragutt / .gitconfig
Last active March 19, 2018 01:14
Git Presentation
[alias]
graph = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%cr)%C(reset) %C(white) %s%C(reset) %C(bold yellow)- %cn%C(reset)%C(bold red)%d%C(reset)' --all
pr = pull --rebase
ob = checkout -b
amend = commit --amend
qam = commit --amend --no-verify --no-edit
tmp = commit --no-verify -m
far-master = !git fetch && git checkout -f master && git reset --hard origin/master
@gioragutt
gioragutt / Docs.md
Last active October 22, 2018 20:48
Docs for creating a game
@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

@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 / 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 / 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 / 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 / links.md
Last active May 10, 2020 08:28
Tracing Links
@gioragutt
gioragutt / __nodejs_lambda_layer
Last active January 8, 2021 14:22
Script for setting up layer for a lambda containing node.js dependencies
...