Skip to content

Instantly share code, notes, and snippets.

@pathtolearn
pathtolearn / 0_reuse_code.js
Created September 4, 2017 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/* Bootstrap 4 Beta 3 - https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css */
.active
.alert
.alert-danger
.alert-dark
.alert-dismissible
.alert-heading
.alert-info
.alert-light
var xhr = new XMLHttpRequest();
xhr.open('GET', 'path to file', true);
xhr.responseType = 'blob';
xhr.onload = function(e) {
var blob = new Blob([xhr.response], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(blob);
var w = window.open(fileURL);
Link : https://askubuntu.com/questions/502781/how-to-give-ubuntu-14-04-more-disk-space
@pathtolearn
pathtolearn / hidden-classes-in-js-and-inline-caching.md
Created March 16, 2018 12:12 — forked from twokul/hidden-classes-in-js-and-inline-caching.md
Hidden classes in JavaScript and Inline Caching

Hidden classes in JavaScript and Inline Caching

Knowing how internals work is always a good. Pretty much for everything. Cars, trains, computers, you name it. It gives you an insight on what happens under the hood. You also act/react differently based on this knowledge.

As you might have guessed, it’s also true for web development. Knowledge of CSS transitions allows you to achieve better performance and not to use JavaScript in most cases. Knowledge of V8 internals allows you to write more performant JavaScript code. So let’s talk about V8 a little.

A little about V8

V8 is a JavaScript engine built by Google. Firefox built SpiderMonkey, Opera built Carakan and Microsoft built Chakra. One very important difference between V8 and other JavaScript engines is that V8 doesn’t generate any intermediate code. It compiles JavaScr

<div id="target" foo="bar"></div>
<br />
<button id="addBtn">Add element</button>
<button id="changeAttributeBtn">Add Attribute</button>
<br />
<br />
<div class="console"></div>
// select the target node
var mysql = require('node-mysql');
var conn = mysql.createConnection({
...
});
var sql = "INSERT INTO Test (name, email, n) VALUES ?";
var values = [
['demian', 'demian@gmail.com', 1],
['john', 'john@gmail.com', 2],
['mark', 'mark@gmail.com', 3],
Object.keys(object).map(key => object[key]);
https://medium.com/chrisburgin/javascript-converting-an-object-to-an-array-94b030a1604c
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
link : https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version
Refer to the link
"files.exclude": {
"node_modules/": true
}
"files.exclude": {
"**/._*": true
}