This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| net = require 'net' | |
| console.log "main" | |
| client = net.connect 8080, ()-> | |
| console.log "connected" | |
| req_message = "GET / HTTP/1.0\r\n\r\n" | |
| client.write req_message | |
| client.on 'data', (data) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var net = require('net') | |
| console.log("main") | |
| var client = net.connect(8080, function() { | |
| console.log("connected") | |
| var req_message = "GET / HTTP/1.0\r\n\r\n" | |
| client.write(req_message) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [color] | |
| ui = auto | |
| [core] | |
| pager = lv -c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| import socket | |
| import time | |
| import struct | |
| import datetime | |
| def calculate_checksum(s): | |
| csum = reduce(lambda a,b: a+b, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyuv | |
| def on_close(tcp): | |
| print "closed" | |
| def on_read(tcp, data): | |
| print "read" | |
| if data is None: | |
| tcp.close(on_close) | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Shape(x, y) { | |
| this.x = x; | |
| this.y = y; | |
| } | |
| Shape.prototype.toString = function() { | |
| return 'Shape at ' + this.x + ', ' + this.y; | |
| }; | |
| function Circle(x, y, r) { |
NewerOlder