My take is that code is not magic. Developers should always seek deeper understanding of the platforms
and languages they use. By doing so; programmers gain valuable confidence and knowledge which in turn
positively impacts code quality, system architecture and productivity.
This file contains hidden or 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
const drivers = ['Vettel', 'Alonso', 'Hamilton'] | |
console.log('Length', drivers.length) // Length = 3 | |
drivers.length = 10 | |
console.log('Length', drivers.length, drivers) // Length = 10 | |
// In Javascript, array is list-like Object | |
console.log(Object.keys(drivers)) |
This file contains hidden or 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
SHOW ENGINE INNODB STATUS; -- InnoDB Monitor output |
This file contains hidden or 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
let axios = { // mocks | |
get: function(x) { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve({data: x}) | |
}, 2000) | |
}) | |
}} | |
let query = 'mangos' | |
async function fetchData(query) { |
This file contains hidden or 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
-- See the size of the directory | |
du -sh /directory/path |
This file contains hidden or 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
-- How to tell what my timezone offset of the database is | |
select @@global.time_zone, @@session.time_zone; | |
select timediff( now(), utc_timestamp()); |
This file contains hidden or 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
exports.config = { | |
// See http://brunch.io/#documentation for docs. | |
files: { | |
javascripts: { | |
joinTo: "js/app.js" | |
// To use a separate vendor.js bundle, specify two files path | |
// http://brunch.io/docs/config#-files- | |
// joinTo: { | |
// "js/app.js": /^js/, |
This file contains hidden or 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
$('body').keypress(function (e) { | |
if(e.which === 13) { | |
e.preventDefault(); | |
} | |
}) |