Skip to content

Instantly share code, notes, and snippets.

@e-mon
e-mon / gist:11051260
Last active August 29, 2015 14:00
proxy servrer(response image converted base64 encoding)
app.get('/proxy', function(req,res){
var url, proxyReq, proxyRequest;
if (req.param('url')) {
url = require('url').parse(req.param('url'));
options = {
host: url.hostname,
port: '80',
path: url.pathname,
method: 'GET'
class SegmentPatternSearch
attr_accessor :patternCache
def initialize()
@segPattern = Array.new(10)
@segPattern[0] = '1111110'
@segPattern[1] = '0110000'
@segPattern[2] = '1101101'
@segPattern[3] = '1111001'
@segPattern[4] = '0110011'
class GemBox
attr_accessor :filPattern
def initialize(boxSize, gemPattern, targetPattern)
@boxSize = boxSize
@gemPattern = gemPattern
@filPattern = Hash.new
@targetPattern = targetPattern
@dayNum = 0
end