Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
function palindrome(str) { | |
//assign a front and a back pointer | |
let front = 0; | |
let back = str.length - 1; | |
//back and front pointers won't always meet in the middle, so use (back > front) | |
while (back > front) { | |
//increments front pointer if current character doesn't meet criteria | |
while ( str[front].match(/[\W_]/) ) { | |
front++; |
//using normal reversing techinque | |
function palindrome1(str){ | |
//removing space and non-alphanumeric characters; | |
str = str.toLowerCase().replace(/[^0-9|a-z]/g,''); | |
//reversing the string | |
var str2 = str.toLowerCase().replace(/[^0-9|a-z]/g,'').split('').reverse().join(''); | |
//checking if both are equal | |
if(str === str2) | |
return true; | |
else |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Bootstrap Multilevel Menu with hover</title> | |
<style id="jsbin-css"> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Multi Line Clipping via CSS</title> | |
<!-- SCSS is used for styling, use a preprocessor to compile it --> | |
<style> | |
body { | |
margin: 0; | |
padding: 50px; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Deepak Kumar Jain</title> | |
</head> | |
<body> | |
<h1>Updating a item in JSON data using 'PUT' method</h1> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Deepak Kumar Jain</title> | |
</head> | |
<body> | |
<h1>Deleting an item in JSON data using 'DELETE' method</h1> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Deepak Kumar Jain</title> | |
</head> | |
<body> | |
<h1>Adding a new collection/data to JSON using 'POST' method</h1> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Deepak Kumar Jain</title> | |
</head> | |
<body> | |
<h1>Fetching JSON data using 'GET' method</h1> |