Skip to content

Instantly share code, notes, and snippets.

@thatseeyou
thatseeyou / dom2json.js
Created March 22, 2017 04:32
웹 페이지의 특정 정보를 추출하여 json 형태로 만들기
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Cmd-R),
* 2. Inspect to bring up an Object Inspector on the result (Cmd-I), or,
* 3. Display to insert the result in a comment after the selection. (Cmd-L)
*/
// run at http://www.zdnet.co.kr
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="./parse_url.js"></script>
<script type="text/javascript">
var url1 = "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content";
@mizzy
mizzy / node-simple-proxy.js
Created November 6, 2011 09:07
Simple proxy made by node.js
var http = require('http');
var url = require('url');
var proxy = http.createServer(function(req, res) {
var request = url.parse(req.url);
options = {
host: request.hostname,
port: request.port || 80,
path: request.path,
method: req.method,
@stathissideris
stathissideris / HashOfHashes.java
Created August 26, 2011 10:48
Hash of hashes example in Java
package test;
import java.util.HashMap;
public class HashOfHashes {
public static void main(String[] args) {
//deep's type is a HashMap with String keys. Its values are Hashes with String keys and values
//Notice how you have to say all that twice, just to be sure :-/
HashMap<String, HashMap<String, String>> deep = new HashMap<String, HashMap<String, String>>();