Skip to content

Instantly share code, notes, and snippets.

@jdnielss
jdnielss / node-npm-in-docker.sh
Created January 10, 2022 17:12 — forked from artemgordinskiy/node-npm-in-docker.sh
Run Node/NPM in a Docker container
# For example, run "npm install"
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container
# Great Success!
@jdnielss
jdnielss / lazy-loading.directive.ts
Created August 23, 2021 17:37
Lazy Loading Directive Angular
import { Directive, ElementRef } from '@angular/core';
@Directive({ selector: 'img' })
export class LazyImgDirective {
constructor({ nativeElement }: ElementRef<HTMLImageElement>) {
const supports = 'loading' in HTMLImageElement.prototype;
if (supports) {
nativeElement.setAttribute('loading', 'lazy');
}
@jdnielss
jdnielss / Animate-SplashScreen
Created February 19, 2020 12:44 — forked from akimabs/Animate-SplashScreen
Animate SplashScreen
import React, {useEffect, useState} from 'react';
import {
View,
SafeAreaView,
StatusBar,
Animated,
StyleSheet,
Text,
} from 'react-native';
import {Colors} from '_styles';