Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@molnarg
molnarg / serverpush.js
Created October 18, 2011 12:23
Node.js server push example
var http = require('http');
var listener;
http.createServer(function (request, response) {
if (request.url === '/listen') {
listener = response;
return;
}
var http = require('http'),
fs = require('fs')
var start = +new Date
var data = 0
var last_calculation = 0
var written = 0
var calculate = function() {
@molnarg
molnarg / index.html
Last active December 15, 2015 15:09 — forked from biovisualize/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<title>Download SVG</title>
<style type="text/css">
a{
cursor: pointer;
text-decoration: underline;
color: black;
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="rajz" width="700" height="700"></canvas>
<script>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="rajz" width="700" height="700"></canvas>
<script>
@molnarg
molnarg / oraimunka.md
Last active December 17, 2015 00:28
Szent Angéla programozás szakkör - 2013. 04. 30.

Szent Angéla programozás szakkör - 2013. 04. 30.

Chrome konzol kisérletezéshez:

  • Konzol megnyitása Chrome-ban: Ctrl+Shift+J
  • Enter: a beírt parancs kiértékelése
  • Shift + enter: parancs folytatása új sorba

Előző jegyzetek puskázáshoz:

@molnarg
molnarg / cfb_monkey_patch.py
Created November 8, 2013 14:41
Monkey patching the python cfb library to support overwrite of data.
from cfb.directory.entry import Entry
from cfb.constants import ENDOFCHAIN
# Monkey patching Entry
def overwrite(self, data):
"""
Writes `data` to the current directory entry at the current position. If
`data` is bigger than the available space in the entry, then the rest of
`data` is ignored. It returns the number of bytes written.
@molnarg
molnarg / test-node-compression.js
Last active January 2, 2016 23:18
The script used to generate the test output of node-http2-protocol for [Jxck's compression test suite](https://github.com/Jxck/hpack-test-case)
var fs = require('fs')
var compressor = require('./node_modules/node-http2-protocol/lib/compressor')
var log = require('./node_modules/node-http2-protocol/test/util').createLogger('test')
var HeaderTable = compressor.HeaderTable;
var HuffmanTable = compressor.HuffmanTable;
var HeaderSetCompressor = compressor.HeaderSetCompressor;
var HeaderSetDecompressor = compressor.HeaderSetDecompressor;
for (var i = 0; i < 31; i++) {