Skip to content

Instantly share code, notes, and snippets.

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],
<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
@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

Link : https://askubuntu.com/questions/502781/how-to-give-ubuntu-14-04-more-disk-space
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);
/* 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
@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