Skip to content

Instantly share code, notes, and snippets.

View elpddev's full-sized avatar

Eyal Lapid elpddev

View GitHub Profile
@elpddev
elpddev / article-hierarchical-di-ng-movies-service.ts
Last active August 28, 2020 20:34
Movies Service #angularjs #medium #article-hierarchical-di-ng
class MoviesService {
static $inject = ['$http', 'auth'];
movies = Promise.resolve([]);
constructor(
private $http: IHttpService,
private auth: AuthService,
) {}
@elpddev
elpddev / article-hierarchical-di-ng-auth-service.ts
Last active August 28, 2020 20:20
Auth Service #angularjs #medium #article-hierarchical-di-ng
class AuthService {
static $inject = ['$http'];
private token: string;
constructor($http: IHttpService) {}
getToken() {
if (_.isNil(this.token)) {
this.token = $http.get('my-site.example.com/auth');
@elpddev
elpddev / article-hierarchical-di-ng-main-module.ts
Last active August 28, 2020 20:13
Main App Module #angularjs #medium #article-hierarchical-di-ng
const moviesApp = angular.module('movies', []);
@elpddev
elpddev / workstation-utilities.md
Last active September 9, 2020 19:14
Utilities and Software for bootstrap workstation

Charles Proxy

Rerwrite Rules

Changing Response Status Code

  • Must have value in match -> value. Otherwise doest not match

Example

Kubernetes Cheetsheat

Deployments

Depoloyment Config

apiVersion: v1
kind: Pod
metadata:
const actions = ()=>{
const functionA = ()=>{/*do sth*/}
const functionB = ()=>{/*do sth*/}
const functionC = ()=>{/*send log*/}
return new Map([
[/^guest_[1-4]$/,functionA],
[/^guest_5$/,functionB],
[/^guest_.*$/,functionC],
//...
@elpddev
elpddev / spacevim.cheatsheet.md
Last active August 8, 2020 08:27
#vim #cheatsheet
@elpddev
elpddev / lerna-docker-cache-packages-json.md
Last active December 24, 2019 16:21
lerna docker image build with cache for packages package.json
FROM node:12.7.0-alpine as node

RUN mkdir -p /usr/src/repo

ADD lerna.json /usr/src/repo/                            
ADD package.json \         
  yarn.lock \            
  .yarnrc \              
 /usr/src/repo/ 
@elpddev
elpddev / lerna-build-related.md
Last active December 24, 2019 16:15
build related packages excluding the main package in lerna