Skip to content

Instantly share code, notes, and snippets.

View ndianabasi's full-sized avatar
🎯
Focusing

Ndianabasi Udonkang ndianabasi

🎯
Focusing
View GitHub Profile
@daviddamilola
daviddamilola / uniqueItems.js
Last active April 12, 2021 09:01
remove duplicates
export const getUniqueItemsFromArray = (array=[]) => {
return Array.from(new Set(array)).length()
}
@magickatt
magickatt / github_clone_using_token.sh
Created September 6, 2019 17:31
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@sam0737
sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@marcogbarcellos
marcogbarcellos / LinkedList.js
Created February 8, 2017 03:52
Linked List Operations on javascript
function Node(value){
this.value = value;
this.next = null;
}
function LinkedList() {
this.start = null;
this.length = 0;
}
LinkedList.prototype.push = function (val) {
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@valarpirai
valarpirai / Facebook like Time ago
Last active December 7, 2023 16:48
Facebook like Time ago in Javascript
// @param - timeStamp - Javascript Date object or date string
// @usage - timeSince(new Date().setFullYear(2019))
function timeSince(timeStamp) {
if (!(timeStamp instanceof Date)) {
timeStamp = new Date(timeStamp);
}
if (isNaN(timeStamp.getDate())) {
return "Invalid date";
}
@bredmor
bredmor / ars-mailserver-add-user
Created July 23, 2014 20:09
Automated tool for adding new users to the default mailserver set up following the guide at http://arstechnica.com/information-technology/2014/02/how-to-run-your-own-e-mail-server-with-your-own-domain-part-1/
#!/bin/bash
# Add User to Postfix/Dovecot
echo -n "Enter the new email address: "
read mail_user
echo -n "Enter the new password: "
read mail_pass
echo "Adding User to Postfix Virtual Mailboxes...";
@bnerd
bnerd / ffmpeg
Created November 13, 2012 23:18
Encode RTMP input stream into multiple outputs with ffmpeg
ffmpeg -re -i rtmp://localhost/live/input_stream -acodec libfaac -ab 128k -vcodec libx264 -s 640x360 -b:v 500k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_500k -acodec libfaac -ab 128k -vcodec libx264 -s 480x272 -b:v 300k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_300k -acodec libfaac -ab 128k -c:v libx264 -s 320x200 -b:v 150k -preset:v fast -profile:v baseline -level 1.2 -r 25 -f flv rtmp://localhost/live/medium_150k -acodec libfaac -vn -ab 48k -f flv rtmp://localhost/live/audio_only
@ryuone
ryuone / getImages.js
Created April 4, 2011 12:52
Node.js program. parseHTML and get Image files to save it.
/* node getImages.js http://www.yahoo.co.jp */
var htmlparser = require('htmlparser');
var sys = require('sys');
var http = require('http');
var fs = require('fs');
var url = require('url');
var path = require('path');
if(process.argv.length !== 3){