Skip to content

Instantly share code, notes, and snippets.

Arnout Kazemier 3rd-Eden

Block or report user

Report or block 3rd-Eden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
'use strict';
var fs = require('fs')
, path = require('path')
, Primus = require('primus')
, EventEmitter = require('events').EventEmitter
, Socket = Primus.createSocket({ transformer: 'engine.io' });
var server = require('http').createServer(function (req, res) {
res.setHeader('Content-Type', 'text/html');
@3rd-Eden
3rd-Eden / index.js
Created Apr 1, 2015
Using the BackBone .extend pattern with React
View index.js
'use strict';
var React = require('react');
React.Component.extend = require('extendible');
var MyComponent = React.Component.extend({
state: {
what: 'extend'
},
render: function () {
@3rd-Eden
3rd-Eden / README.md
Created Mar 16, 2015
BigPipe & React sitting a tree.
View README.md
  • BigPipe and React
  • React components
  • Share state
  • Server Side rendering
  • Modularization of components
  • Re-initialization
    • checksum
    • event adding
    • html bloat
  • JSX
View component.jsx
/** @jsx React.DOM **/
<div>
<FormattedMessage
message={getIntlMessage('post.meta')}
num={props.post.comments.length}
ago={<FormattedRelative value={props.post.date} />}
/>
<span>{random}</span>
</div>
View gist:e805ac3d329abdfe3892
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/Users/V1/.nvm/v0.10.35/bin/npm', 'install', '.' ]
2 info using npm@2.3.0
3 info using node@v0.10.35
4 warn package.json utf-8-validate@1.0.0 No README data
5 verbose install where, deps [ '/Users/V1/Projects/websockets/utf-8-validate',
5 verbose install [ 'bindings', 'nan' ] ]
6 verbose install where, peers [ '/Users/V1/Projects/websockets/utf-8-validate', [] ]
7 info preinstall utf-8-validate@1.0.0
8 silly cache add args [ 'bindings@1.2.x', null ]
@3rd-Eden
3rd-Eden / failing.js
Created Dec 16, 2014
URL parsing regexp.
View failing.js
/^(?:(?:(([^:\/#\?]+:)?(?:(?:\/\/)(?:(?:(?:([^:@\/#\?]+)(?:\:([^:@\/#\?]*))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/.exec('https://www.mozilla.org/en-US/firefox/34.0/whatsnew/?oldversion=33.1')
@3rd-Eden
3rd-Eden / blobhack.js
Last active Aug 29, 2015
URL generation inside WebWorker which is generated through a blob.
View blobhack.js
var x = new Blob(['var loc = location; if (location.protocol === "blob:") loc = new URL(unescape(loc.pathname)); console.log(new URL("/foo", loc)); '], { type: 'text/javascript' })
, y = URL.createObjectURL(x)
, w = new Worker(y);
@3rd-Eden
3rd-Eden / README.md
Last active Mar 22, 2018
Protecting against POODLE in node.js
View README.md

[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.

View gist:6d150687d7a5d2696507
12:55:01 PM <omnidan> hi
12:55:58 PM ⇐ therealkoopa quit (~therealko@pool-108-52-202-109.phlapa.fios.verizon.net) Ping timeout: 255 seconds
12:56:07 PM <omnidan> is it possible to get the query in the authorization middleware without having a http server running? e.g. directly connecting from a nodejs primus client to a primus server
12:56:29 PM <omnidan> also, is it possible to connect with a socket.io-client to primus with socket.io in the backend?
1:06:03 PM → __quim_ and Kullt2 joined ⇐ __quim and Kullt quit ↔ therealkoopa popped in
1:34:29 PM <_3rdEden> hi
1:35:05 PM <_3rdEden> How would you get a request to your server when there isn't a server running omnidan ?
1:35:51 PM <_3rdEden> omnidan: it should be possible to connect with a socket.io-client to a primus + socket.io backend
1:36:00 PM <omnidan> _3rdEden: well there is a http server running, but I'm connecting via nodejs directly to primus, so it doesn't /use/ the server
1:36:13 PM <omnidan> at least I think so, I'm not familiar with the inter
You can’t perform that action at this time.