Table of Contents generated with DocToc
setInterval(function(){ | |
if(document.querySelector(".icon.icon-smiley.btn-emoji") != null) | |
document.querySelector(".icon.icon-smiley.btn-emoji").click(); | |
document.querySelector(".emojik.emojiordered1200").click(); | |
document.querySelector(".icon.btn-icon.icon-send.send-container").click(); | |
}, 500); |
function getRandomColor() { | |
var letters = '0123456789ABCDEF'; | |
var color = '#'; | |
for (var i = 0; i < 6; i++ ) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} |
http://twitter.com/home?status=[TITLE]+[URL] | |
Digg | |
http://www.digg.com/submit?phase=2&url=[URL]&title=[TITLE] | |
http://www.facebook.com/share.php?u=[URL]&title=[TITLE] | |
StumbleUpon |
var express = require('express'); | |
var session = require('express-session'); | |
var cookieParser = require('cookie-parser'); | |
var flash = require('connect-flash'); | |
var app = express(); | |
app.use(cookieParser('secret')); | |
app.use(session({cookie: { maxAge: 60000 }})); | |
app.use(flash()); |
Hex Opacity Values | |
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 |
Years ago, some smart folks that worked on JS engines realized that not all JS that's loaded into a page/app initially is needed right away. They implemented JIT to optimize this situation.
JIT means Just-In-Time, which means essentially that the engine can defer processing (parsing, compiling) certain parts of a JS program until a later time, for example when the function in question is actually needed. This deferral means the engine is freer to spend the important cycles right now on the code that's going to run right now. This is a really good thing for JS performance.
Some time later, some JS engine devs realized that they needed to get some hints from the code as to which functions would run right away, and which ones wouldn't. In technical speak, these hints are called heuristics.
So they realized that one very common pattern for knowing that a function was going to run right away is if the first character before the function
keyword was a (
, because that usually m
// mongoose 4.3.x | |
var mongoose = require('mongoose'); | |
/* | |
* Mongoose by default sets the auto_reconnect option to true. | |
* We recommend setting socket options at both the server and replica set level. | |
* We recommend a 30 second connection timeout because it allows for | |
* plenty of time in most operating environments. | |
*/ | |
var options = { server: { socketOptions: { keepAlive: 300000, connectTimeoutMS: 30000 } }, |
I hereby claim:
- I am arshdkhn1 on github.
- I am arshdkhn1 (https://keybase.io/arshdkhn1) on keybase.
- I have a public key ASBWaziczjSQHUbAQzWKWrLU1er2gvrX45TAYHZ2ye9ZUAo
To claim this, I am signing this object:
function isNull(v) { | |
return typeof v === "object" && !v; | |
} | |
function isPrimitive(v) { | |
return ["number", "string", "boolean", "undefined"].indexOf(typeof v) !== -1 || isNull(v); | |
} | |
function isPlainObject(o) { | |
return o && typeof o === "object" && o.constructor === Object; |