Skip to content

Instantly share code, notes, and snippets.

View reqshark's full-sized avatar
🪂
ridge soaring

Bent Cardan reqshark

🪂
ridge soaring
View GitHub Profile

Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward discussions repo

io.js - what you need to know

io-logo-substack

  • io is a fork of node v0.12 (the next stable version of node.js, currently unreleased)
  • io.js will be totally compatible with node.js
  • the people who created io.js are node core contributors who have different ideas on how to run the project
  • it is not a zero-sum game. many core contributors will help maintain both node.js and io.js
/* Thu Oct 30 06:48:25 +0100 2014:
This file was generated by mill from helloserver.mc */
#include <stdmill.h>
/* This example is a TCP server application that accepts connections and
sends "Hello, world!" to each of them. Afterwards it closes the connection.
Use telnet to connect to it: "telnet 127.0.0.1 7000". */
#include <stdmill.h>
@joannaong
joannaong / ulimit
Last active September 16, 2016 01:06
ulimit
ulimit -n 2560
@allolex
allolex / find_attackers.pl
Last active February 20, 2020 18:13
Script to scour Apache logs for IP's performing brute-force password attacks on WordPress sites
#!/usr/bin/env perl
use strict;
use warnings;
my %config = (
'limit' => 20000,
'name' => '/var/log/apache2/blog.access.log'
);
my $lines = get_lines(\%config);

Attoparsec Cheatsheet (vs. Regex)

Preconditions

  • OverloadedString extension is applied.
  • The following modules are imported.
    • Control.Applicative
    • Data.Attoparsec.Text
    • Data.Char
@vol4ok
vol4ok / gist:9364446
Last active August 29, 2015 13:57
on ng-repeat finish directive for angular js
angular.module("app").directive("onRepeatFinish", ["$timeout", function($timeout){
return {
restrict: "A",
link: function($scope, $element, $attrs) {
if ($scope.$last) {
$timeout(function(){
if (angular.isFunction($scope[$attrs["onRepeatFinish"]]))
$scope[$attrs["onRepeatFinish"]]()
});
}

Virtual DOM and diffing algorithm

There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.

However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.

@rvagg
rvagg / leveldb.js.md
Created January 10, 2014 01:48
Modular JavaScript storage for databases

Summary: Introduce a totally new approach to highly modular database storage, i.e. taking the vibrant Node.js Level ecosystem below LevelUP to the storage layer in 100% JavaScript.*

Facebook recently released their fork of LevelDB, named "RocksDB". Their fork is a true fork in the sense that it is not backward compatible. Facebook have added a number of new features to RocksDB but more importantly they are attempting to make something more flexible that can be adjusted to suit different workloads.

But this is not about Facebook or RocksDB because they are still riffing on the same tune, albeit with a faster tempo. But their attempt at flexibility hints at the possibilities of modular storage technologies.

The Node.js Level* ecosystem is vibrant and growing rapidly. Most of this growth is in user-land above the storage layer. In 2014 I would like to see more innovation at the storage layer itself. Facebook are demonstrating a very limited kind of modularity in RocksDB but we believe that Node.js is mu

@max-mapper
max-mapper / readme.md
Last active August 8, 2016 18:45
simple 4mb buffer proxy benchmarks

simple 4mb buffer proxy benchmarks

the goal: to do fast virtual host routing, e.g. to have a single process on a machine listening on port 80 and proxying data based on HTTP Host to other non-port-80 web processes on the same machine

many people use nginx for this because nginx is faster than node is currently for data-heavy applications (see below)

about these benchmarks

they use the JS proxies from https://github.com/substack/bouncy/tree/master/bench

@jedi4ever
jedi4ever / broker.js
Last active October 1, 2021 13:39
xsub , xpub example in nodejs
var pubListener = 'tcp://127.0.0.1:5555';
var subListener = 'tcp://127.0.0.1:5556';
var hwm = 1000;
var verbose = 0;
// The xsub listener is where pubs connect to
var subSock = zmq.socket('xsub');
subSock.identity = 'subscriber' + process.pid;
subSock.bindSync(subListener);