Skip to content

Instantly share code, notes, and snippets.

@oelbaga
oelbaga / 01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Last active August 15, 2025 20:16
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands
#based on my YouTube video
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build
#login to server
ssh root@ip_address
#Upgrade Server - may take a few minutes
sudo apt update
sudo apt upgrade
@Rwin90
Rwin90 / click-outside.directive.ts
Created March 18, 2018 10:14
angular 4 directive that emit an event when click event happen outside of target
import {Directive, ElementRef, Output, EventEmitter, HostListener} from '@angular/core';
@Directive({
selector: '[appClickOutside]'
})
export class ClickOutsideDirective {
constructor(private _elementRef: ElementRef) {
}
@Output()
@Rwin90
Rwin90 / its-my-scroll.directive.ts
Last active May 15, 2018 09:03
its an angular 4+ directive that prevent parent element scroll after child element scroll rich to end
import {Directive, ElementRef, HostListener} from '@angular/core';
@Directive({
selector: '[appMyScroll]'
})
export class ItsMyScrollDirective {
constructor(private _elementRef: ElementRef ) {
}