Skip to content

Instantly share code, notes, and snippets.

@Metnew
Metnew / keybase.md
Created October 28, 2018 15:04
keybase.md

Keybase proof

I hereby claim:

  • I am metnew on github.
  • I am metnew (https://keybase.io/metnew) on keybase.
  • I have a public key ASARCDaHnKF8_DpR8aRWgXgFF83kdL8nJoYPE2AhYwIn5Ao

To claim this, I am signing this object:

ttps://github.com/santinic/how2
https://github.com/Swaagie/stackexchange
https://github.com/probot/probot
https://github.com/probot/commands
https://github.com/probot/unfurl
@Metnew
Metnew / dump-window-keys.html
Created October 15, 2018 20:22
dumps window keys, useful in mobile browsers (in very rare cases)
<html>
<body>
<script>
const win = Object.keys(window)
fetch('http://192.168.0.101:3000/browsers', {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
chrome-devtools://devtools
chrome-devtools://devtools/bundled/js_app.html?debugFrontend&_remoteBase&experiments&remoteBase&test&panel&ws&wss&service-backend&can_dock
static _isDescriptorEnabled(descriptor) {
const activatorExperiment = descriptor['experiment'];
if (activatorExperiment === '*')
return Runtime.experiments.supportEnabled();
if (activatorExperiment && activatorExperiment.startsWith('!') && Runtime.experiments.isEnabled(activatorExperiment.substring(1)))
return false;
if (activatorExperiment && !activatorExperiment.startsWith('!') && !Runtime.experiments.isEnabled(activatorExperiment))
return false;
@Metnew
Metnew / README.md
Created October 8, 2018 01:34
Vulnerabilities in compressing engines

hacking-compressing-engines

Vulnerabilities in compressing engines

Intro

Explanations/writeups/PoCs for vulnerabilities in compressing engines are much more googleable than for vulnerabilities in browsers/OS. It's easy to find more info about the vulnerability by CVE number.

libarchive

HMR:

Separate processes

You’re run your frontend using webpack-dev-middleware and webpack-hot-middleware, but you can’t run both client and server from one process, so you run server using separate process. You can’t test you

Ultimate-hot-reloading-example

You find ultimate-hot-reloading-example. It’s a cool, but still you need to watch your files with chokidar(file-system watcher). And you can’t compile server with Webpack.

Webpack-hot-server-middleware

It’s a great middleware that allow you to write code for server-side rendering in development. Webpack-dev-middleware has serverSideRenderer option.

import {getThatVariable} from ‘selectors’
// ...
const mapStateToProps = (state) => {
 // GOOD!
 return {variable: getThatVariable(state)}
}
const mapStateToProps = (state) => {
 // BAD!!!
 const {something=768} = state.hello && state.hello.world
const {similar=0} = state.let.var && state.let.var.be && state.let.var.be.const
return {variable: similar + something}
}
interface State {
 entities: object;
 fetchStatus: ‘none’ | ‘loading’ | ‘loaded’;
 errors: object;
}