Skip to content

Instantly share code, notes, and snippets.

View sayem314's full-sized avatar
:atom:
Coding as always...

Sayem Chowdhury sayem314

:atom:
Coding as always...
View GitHub Profile
@sayem314
sayem314 / nodemon.json
Last active April 22, 2021 16:33
typescript and esm project config for nodemon
{
"restartable": "rs",
"ignore": [".git", "node_modules"],
"verbose": true,
"execMap": {
"ts": "node --loader ts-node/esm"
},
"watch": ["src"],
"env": {
"NODE_ENV": "development"
@sayem314
sayem314 / progress-hooks.ts
Last active April 21, 2021 17:56
Progress hooks for react-native-track-player. This hooks updates when player is playing or seeking.
import { useEffect, useState } from 'react';
import TrackPlayer, { TrackPlayerEvents } from 'react-native-track-player';
type Delay = number | null;
type TimerHandler = () => void;
/**
* Provides a declarative useInterval
* @param callback - Function that will be called every `delay` ms.
* @param delay - Number representing the delay in ms. Set to `null` to "pause" the interval.
@sayem314
sayem314 / mem.sh
Created September 30, 2016 14:06
processs memory check on linux
#!/bin/bash
ps -C $1 -O rss | awk '{ count ++; sum += $2 }; END {count --; print "Number of processes =",count; print "Memory usage per process =",sum/1024/count, "MB"; print "Total memory usage =", sum/1024, "MB" ;};'