Skip to content

Instantly share code, notes, and snippets.

View elpddev's full-sized avatar

Eyal Lapid elpddev

View GitHub Profile
@elpddev
elpddev / README.md
Last active July 24, 2023 04:49
Zellij Cheatsheet

WIP

Zellij CheatSheet

From the site:

Zellij is a terminal workspace. It has the base functionality of a terminal multiplexer (similar to tmux or screen) but includes many built-in features that would allow users to extend it and create their own personalized environment.

Tutorials

@elpddev
elpddev / neovim-setup-from-scratch.md
Last active May 12, 2025 19:41
Neovim Setup from Scratch (Based on ThePrimeagen)
@elpddev
elpddev / clamp.js
Created November 15, 2022 08:01
Clamp number to a range. If below min then min, If above max then max
const clamp = (min: number, max: number, val: number) =>
Math.max(min, Math.min(val, max));
@elpddev
elpddev / article-hierarchical-di-service-directive-heirarchy-in-action.ts
Created August 29, 2020 09:21
Service directive in action #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-auth-service-directive-usage.ts
Created August 29, 2020 08:34
AngularJs auth service directive usage #angularjs #medium #article-hierarchical-di-ng
class MoviesList {
}
const MoviesListComponent = {
template: `
<h1>Movies</h1>
<ul>
<li ng-repeat="movie in ($ctrl.movies.movies | promiseAsync) track by movie.id">
{{ movie.name }} - {{ movie.year }} - {{ movie.rating }}
</li>
@elpddev
elpddev / article-hierarchical-di-auth-service-directive.ts
Last active August 29, 2020 08:38
AngularJs auth service directive #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-require-component.ts
Created August 29, 2020 08:12
AngularJs require component #angularjs #medium #article-hierarchical-di-ng
angular.component('printout', {
template: `<div>{{ $ctrl.model | json:2 }}</div>,
require: {
ngModel: '',
},
controller: ['$sce', '$element', function controller($sce, $element) {
this.$onInit = () {
this.ngModel.$render = function() {
$element.html($sce.getTrustedHtml(this.ngModel.$viewValue || ''));
};
@elpddev
elpddev / article-hierarchical-di-ng-require-directive.ts
Last active August 29, 2020 08:13
AngularJs require directive #angularjs #medium #article-hierarchical-di-ng
moviesApp.directive('printout', ['$sce', function printout($sce) {
return {
restrict: 'A',
require: {
ngModel: ''
},
link: (scope, element, attrs, requireCtrls) {
requireCtrls.ngModel.$render = function() {
element.html($sce.getTrustedHtml(requireCtrls.ngModel.$viewValue || ''));
};
@elpddev
elpddev / article-hierarchical-di-ng-ng2-component-di.ts
Created August 29, 2020 07:40
Ng2 Component DI #angularjs #medium #article-hierarchical-di-ng
@Component({
...
providers: [{ provide: AuthService }]
})
export class EastAndorMovieList
@elpddev
elpddev / article-hierarchical-di-ng-movies-list-comp.ts
Last active August 29, 2020 08:38
Movies List Component #angularjs #medium #article-hierarchical-di-ng
class MoviesList {
static $inject = ['movies'];
constructor(
movies: MoviesService
)
}
const MoviesListComponent = {
template: `