Skip to content

Instantly share code, notes, and snippets.

View michaelNgiri's full-sized avatar
🏠
Working from home

Ngiri Michael michaelNgiri

🏠
Working from home
View GitHub Profile
@michaelNgiri
michaelNgiri / media.service.ts
Created November 15, 2023 07:52 — forked from AngelMunoz/media.service.ts
a simple typescript class that deals with the HTML Media API for camera stuff
export interface ISwitchCameraArgs {
deviceId?: string
}
export interface IStartCameraArgs {
constraints?: MediaStreamConstraints;
retryCount?: number;
}
export interface ICameraDevice extends MediaDeviceInfo {
@michaelNgiri
michaelNgiri / stuns
Created October 25, 2021 15:24 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@michaelNgiri
michaelNgiri / paginated.js
Created January 16, 2020 20:35 — forked from jstott/paginated.js
lodash paginated items
function getPaginatedItems(items, page, pageSize) {
var pg = page || 1,
pgSize = pageSize || 100,
offset = (pg - 1) * pgSize,
pagedItems = _.drop(items, offset).slice(0, pgSize);
return {
page: pg,
pageSize: pgSize,
total: items.length,
total_pages: Math.ceil(items.length / pgSize),