Skip to content

Instantly share code, notes, and snippets.

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

Irfan Maulana mazipan

🏠
Working from home
View GitHub Profile
@mazipan
mazipan / snippet.js
Created January 23, 2018 03:22 — forked from psdtohtml5/snippet.js
JavaScript : Add Business days to a date
// https://github.com/lsmith/addBusinessDays/blob/master/addBusinessDays.js
// var d = new Date();
// addBusinessDays(d, numberOfDays);
function addBusinessDays(d,n) {
d = new Date(d.getTime());
var day = d.getDay();
d.setDate(d.getDate() + n + (day === 6 ? 2 : +!day) + (Math.floor((n - 1 + (day % 6 || 1)) / 5) * 2));
return d;
}
@mazipan
mazipan / git-clearHistory
Created January 9, 2018 05:30 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@mazipan
mazipan / README-Template.md
Created July 20, 2017 11:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites