Skip to content

Instantly share code, notes, and snippets.

View 3rd-Eden's full-sized avatar
💭
I have approximate knowledge of many things

Arnout Kazemier 3rd-Eden

💭
I have approximate knowledge of many things
View GitHub Profile
@wybiral
wybiral / noscript-tracking.go
Last active September 11, 2023 08:53
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@paulirish
paulirish / what-forces-layout.md
Last active May 11, 2024 00:41
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@nsimmons
nsimmons / ReactNative-Deep-Dive.md
Last active October 9, 2023 07:48
ReactNative Deep Dive
@theoperatore
theoperatore / login.js
Last active January 20, 2016 17:00
Node.js Destiny API Authentication
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
@3rd-Eden
3rd-Eden / README.md
Last active January 4, 2021 10:20
Protecting against POODLE in node.js

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

@netpoetica
netpoetica / Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4).md
Last active August 7, 2022 09:25
Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4), Link Clang to Static Libraries, properly configure your environment for v8 build

Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4)

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.

1) Get the v8 source

git clone https://github.com/v8/v8.git

2) Install depot tools

@lygaret
lygaret / index.js
Last active January 18, 2023 17:26
ES6 Quasi-Literal for JSX
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
@lpinca
lpinca / client.js
Created December 20, 2013 09:32
Primus WebSocket not opened issue
'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