Skip to content

Instantly share code, notes, and snippets.

View ni8mr's full-sized avatar
🇧🇩
Busy in concept building, guiding team and development

Noor Faizur Reza ni8mr

🇧🇩
Busy in concept building, guiding team and development
View GitHub Profile
@ni8mr
ni8mr / Beanstalk_to_GitHub
Created November 22, 2021 04:23 — forked from DevinWalker/Beanstalk_to_GitHub
Move Git Repository from Beanstalk to GitHub with full repository history
#Example moving the DPSG Global Library
# 1 Checkout the Beanstalk Repo
git clone --bare [email protected]:/dpsg-global-library.git
# 2 Push into your desired GitHub repo. (Please note that you must create the github repo prior to this step)
git push --mirror [email protected]:codeandtheory/dpsg-global-library.git
@ni8mr
ni8mr / conditional-json.js
Created November 3, 2021 08:51 — forked from mattlockyer/conditional-json.js
Using spread syntax to conditionally add JSON key, value to object. Fetch example using POST and Authorization.
export const POST = (auth) => ({
method: "POST", // *GET, POST, PUT, DELETE, etc.
mode: "cors", // no-cors, cors, *same-origin
headers: {
"Content-Type": "application/json",
...(auth ? { "Authorization": auth } : {})
},
})
@ni8mr
ni8mr / git.migrate
Created May 3, 2021 08:32 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@ni8mr
ni8mr / msconvert.js
Created April 12, 2021 08:58 — forked from remino/msconvert.js
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS(ms) {
var d, h, m, s;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
return { d: d, h: h, m: m, s: s };
@ni8mr
ni8mr / nvmCommands.js
Created January 7, 2020 04:54 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
@ni8mr
ni8mr / datepicker.md
Created December 11, 2018 09:54 — forked from zmts/datepicker.md
Vuejs-datepicker disable dates
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jre
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
@ni8mr
ni8mr / ReadMe.txt
Created March 6, 2018 09:10 — forked from vubon/ReadMe.txt
Install PostgreSQL in Ubuntu 16.04
#Update your apps by below command and install
$ sudo apt-get update
$ sudo apt-get install postgresql postgresql-contrib
#Connect to PostgreSQL
$ sudo su - postgres
$ psql
#Checking connection with user information
@ni8mr
ni8mr / gist:eee2da1bebcd7c783f77dcb23372dc07
Created February 14, 2018 08:44
Remove unpushed commit in Git

Delete the most recent commit:

git reset --hard HEAD~1

Delete the most recent commit, without destroying the work you've done:

git reset --soft HEAD~1

@ni8mr
ni8mr / hello.js
Last active November 9, 2016 08:15
// Initial "Hello world" app using NodeJS
var http = require('http');
http.createServer(function(req, res){
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, 'localhost');
// Initial "Hello world" app using express.js
var express = require('express')