This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The NPER function is a financial function that returns the number of periods for loan or investment | |
// rate - The interest rate per period. | |
// payment - The payment made each period. | |
// present - The present value, or total value of all payments now. | |
// future - [optional] The future value, or a cash balance you want after the last payment is made. Defaults to 0. | |
// type - [optional] When payments are due. 0 = end of period. 1 = beginning of period. Default is 0. | |
NPER(rate, payment, present, future, type) { | |
// Initialize type | |
type = (typeof type === 'undefined') ? 0 : type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flatJSON = [ | |
{ | |
name : "A", | |
parent : "root" | |
}, | |
{ | |
name : "B", | |
parent : "root" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content{ | |
/*supports modern browsers but not IE*/ | |
width: 10vmax; | |
/*calculate vmax for IE */ | |
height: calc(10 * (1vw + 1vh - 1vmin)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Approach 1 - transform translateX/translateY:*/ | |
.centerDiv { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translateX(-50%) translateY(-50%); | |
} | |
/*Approach 2 - Flexbox method:*/ | |
html, body, .centerDiv { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Different CSS for Different Browsers"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Nitin - Diff CSS for Diff Browser</title> | |
<style id="jsbin-css"> | |
/* Default */ | |
body{background: orange;} |