Skip to content

Instantly share code, notes, and snippets.

🐋
Thanks for the fish!

Fedor Indutny indutny

🐋
Thanks for the fish!
Block or report user

Report or block indutny

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 twitter-contest.js
!function() {
// Don't forget to scroll all the way down to load all replies!
const elems = document.body.querySelectorAll(
'div.original-permalink-page ' +
'li.ThreadedConversation:not(.ThreadedConversation--selfThread),' +
'li.ThreadedConversation--loneTweet');
for (const elem of elems) {
elem.style.border = '2px solid green';
View quiz.js
'use strict';
// Quiz:
//
// Implement `solution` function using only calls to API methods below and no
// other JS primitives (even math).
//
// Correct implementation will print "Success!" once executed
//
@indutny
indutny / crypto-browserify.svg
Last active Jul 4, 2017
crypto-browserify CommonJS dependency graph.
View crypto-browserify.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@indutny
indutny / info.md
Last active Nov 22, 2016
"Xcode - lldb" version correspondence
View info.md

Thank you for participation, we've managed to find these versions together:

  • xcode 8.2 - 360.1.68
  • xcode 8.1 - 360.1.65
  • xcode 8 - 360.1.50
  • xcode 7.3.1 - 350.0.21
  • xcode 7.3.0 - 350.0.21
  • xcode 7.2 - 340.4.119
  • xcode 7.1 - 340.4.110
  • xcode 7.0 - 340.4.70
@indutny
indutny / 0-HOWTO.md
Last active Nov 4, 2015
FLUSH+RELOAD in node.js
View 0-HOWTO.md

How to run this

  1. Take any binary that has OpenSSL functions listed in collect.js
  2. Open lldb /path/to/binary
  3. Do disas -n function-name for each function in collect.js
  4. Choose some offset near the end of the function
  5. Subtract 0x1000000000 to get file offset
  6. Put the number in collect.js
  7. Run node collect.js /path/to/binary | node filter.js > log
  8. Let it run for some time to collect enough information
@indutny
indutny / example.js
Created Oct 11, 2015
json-pipeline usage example
View example.js
// Just for viewing graphviz output
var fs = require('fs');
var Pipeline = require('json-pipeline');
var Reducer = require('json-pipeline-reducer');
var Scheduler = require('json-pipeline-scheduler');
//
// Create empty graph with CFG convenience
// methods.
View ciphers.d
#!/usr/sbin/dtrace -C -s
#pragma D option quiet
#pragma D option strsize=4096
#define PTR__SIZE sizeof(uint64_t)
struct SSL {
uint32_t version;
uint8_t pad[0x12c];
View iojs-c++-streams.md

stream_base: introduce StreamBase

StreamBase is a brand new way to write C++ streams. The class itself is for separting StreamWrap (with the methods like .writeAsciiString, .writeBuffer, .writev, etc) from the HandleWrap class, making possible writing abstract C++ streams that are not bound to any uv socket.

Important part of the abstraction is following methods (which mimics libuv's stream API):

View bignum-vs-bn.txt
Benchmarking: create-10
bn.js#create-10 x 1,967,120 ops/sec ±1.65% (9 runs sampled)
bignum#create-10 x 642,220 ops/sec ±0.80% (8 runs sampled)
------------------------
Fastest is bn.js#create-10
========================
Benchmarking: create-hex
bn.js#create-hex x 2,610,191 ops/sec ±0.85% (9 runs sampled)
bignum#create-hex x 614,238 ops/sec ±2.36% (9 runs sampled)
------------------------
View keybase.md

Keybase proof

I hereby claim:

  • I am indutny on github.
  • I am indutny (https://keybase.io/indutny) on keybase.
  • I have a public key whose fingerprint is AF2E EA41 EC34 47BF DD86 FED9 D706 3CCE 19B7 E890

To claim this, I am signing this object:

You can’t perform that action at this time.