![]() |
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
var request = require('request'); | |
var Promise = require('es6-promise').Promise; | |
var cjar = request.jar(); | |
var PSN_OAUTH_URI = "https://auth.api.sonyentertainmentnetwork.com/login.do"; | |
var BUNGIE_SIGNIN_URI = "https://www.bungie.net/en/User/SignIn/Psnid"; | |
// Returns a promise fullfilled with the response of the | |
// request, or rejected with the error |
[Google recently announced][poodle] that there is an exploit in SSLv3, this vulnerability is know as POODLE. There is no other option than to disable SSLv3 in order to combat this major flaw. There have already been [guides on how to disable this in different servers][guides]. But nothing excised for Node.js yet, until now. In order to resolve this for Node.js we need to use various of undocumented options and modules.
In the index.js
file below you can see an example of how you can protect your HTTPS server
against the POODLE attack. It uses the secureOptions
option to pass in constants in to the
SSL context which is created by node.
by Keith Rosenberg (netpoetica)
Note: do this in some sort of project/ directory that makes sense. depot_tools are going to need to be in your path, so you may want to install them somewhere you are comfortable with.
git clone https://github.com/v8/v8.git
define(function(require) { | |
var React = require('react'); | |
var paramRegex = /__(\d)+/; | |
var parser = new DOMParser(); | |
var errorDoc = parser.parseFromString('INVALID', 'text/xml'); | |
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI; | |
// turns the array of string parts into a DOM | |
// throws if the result is an invalid XML document. |
/** @jsx React.DOM */ | |
define([ | |
'react', | |
'modernizr', | |
'punycode' | |
], function(React, Modernizr, punycode) { | |
/** | |
* Replaces the emojis in a text string with <img> tags |
'use strict'; | |
var Ws = require('ws') | |
, ws = new Ws('ws://localhost:3000/primus'); | |
ws.on('open', function() { | |
var buf = new Buffer([ | |
0x88, // state.lastFragment = true && opcode = 8 | |
0x02, // state.masked = false && length = 2 | |
0x03, // this byte and the next => code = 1000 |