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
/* | |
LiquidCrystal Library - Hello World | |
Demonstrates the use a 16x2 LCD display. The LiquidCrystal | |
library works with all LCD displays that are compatible with the | |
Hitachi HD44780 driver. There are many of them out there, and you | |
can usually tell them by the 16-pin interface. | |
This sketch prints "Hello World!" to the LCD | |
and shows the time. |
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
// Promise that takes 5 sec to resolve an array of data | |
const fetchData = new Promise((resolve, reject) => { | |
console.log("fetchData, called"); | |
setTimeout(() => { | |
resolve(["1", "2", "3", "4", "5"]); | |
}, 5000); | |
}); | |
const getData = async number => { | |
console.log("getData, called"); |
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
--------------------------------- | |
# REST | |
Http Method | Request Payload | Sample URI | Response Payload | |
GET | - | /api/authors | author collection | |
/api/authors/{authorId} | single author | |
POST | single author | /api/authors | single author | |
PUT | single author | /api/authors/{authorId} | single author or empty | |
PATCH | JsonPatchDocument on author | /api/authors/{authorId} | single author or empty |
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
//https://www.peterbe.com/plog/data-and-attr-in-jquery | |
I learned something today thanks to my colleague Axel Hecht; the difference between $element.data('foo') and $element.attr('data-foo'). | |
Basically, the .data() getter/setter is more powerful since it can do more things. For example: | |
<img id="image" data-number="42"> | |
// numbers are turned to integers |
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
//https://stackoverflow.com/questions/39221775/trigger-for-span-text-html-on-changed | |
//you can use DOMSubtreeModified to track changes on your span element i.e(if text of your span element changes dynamically ). | |
$('.user-location').on('DOMSubtreeModified',function(){ | |
alert('changed') | |
}) |
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
$(document).on('click', function(event) { | |
if (!$(event.target).closest('#menucontainer').length) { | |
// Hide the menus. | |
} | |
}); | |
// source: https://css-tricks.com/dangers-stopping-event-propagation/ | |
// author: Philip Walton (@philwalton) |
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> | |
<!-- | |
Author: Miguel Jesus | |
Email: migl.rodri@gmail.com | |
Copyright: You can freely use this snippet and if you could leave a comment. | |
About: | |
Well, in some of my projects i run into a problem of customizing a select input box. |