This file contains 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
require 'json' | |
output = {} | |
File.open('desk.txt').each do |line| | |
data = line.split('|') | |
key = data[0].strip | |
value = data[1].strip | |
output[key]=value | |
end | |
puts output.to_json |
This file contains 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 fs = require('fs'), | |
request = require('request'), | |
sizeOf = require('image-size'); | |
var url = "http://www.dailytechtuts.com/wp-content/uploads/cute-white-rat.jpg"; | |
var file_path = '/tmp/google.png' | |
var download = function(uri, filename, callback){ | |
request.head(uri, function(err, res, body){ | |
console.log('content-type:', res.headers['content-type']); |
This file contains 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
require 'socket' | |
sk = TCPSocket.new("localhost", "1080") | |
fp = File.open("readin.txt") | |
fp.each_line do |line| | |
to_write = "#{line}\n".force_encoding("utf-8") | |
sk.write(to_write) | |
puts to_write | |
end | |
fp.close() |
This file contains 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
public class ObserverX implements Observer{ | |
@Override | |
public void onStateChange(){ | |
System.out.println("data received"); | |
} | |
@Override | |
public void onMessage(Buffer buffer){ | |
System.out.println(buffer.toString()); | |
} | |
} |
This file contains 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
require 'rubygems' | |
require 'json' | |
require 'selenium-webdriver' | |
require 'colorize' | |
require 'pry' | |
## Variables | |
@username = ARGV[0] | |
@key = ARGV[1] | |
@session_id = ARGV[2] |
This file contains 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 webdriver = require('wd') | |
, assert = require('assert') | |
, colors = require('colors'); | |
var http = require('http'); | |
var globalTunnel = require('global-tunnel'); | |
globalTunnel.initialize({ | |
host: 'localhost', // set proxy ip or hostname | |
port: 9091, // set proxy port |
This file contains 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
require 'rubygems' | |
require 'selenium-webdriver' | |
# Input capabilities | |
caps = Selenium::WebDriver::Remote::Capabilities.new | |
caps["browser"] = "chrome" | |
caps["browser_version"] = "33.0" | |
caps["os"] = "Windows" | |
caps["os_version"] = "8.1" | |
caps["browserstack.debug"] = "true" |
This file contains 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 webdriver = require('selenium-webdriver'); | |
var http = require('http'); | |
var globalTunnel = require('global-tunnel'); | |
globalTunnel.initialize({ | |
host: 'localhost', // set proxy ip or hostname | |
port: 9091, // set proxy port | |
sockets: 50 // optional pool size for each http and https | |
}); |
This file contains 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 http = require('http'); | |
var globalTunnel = require('global-tunnel'); | |
globalTunnel.initialize({ | |
host: 'localhost', // set proxy ip or hostname | |
port: 9091, // set proxy port | |
sockets: 50 // optional pool size for each http and https | |
}); | |
NewerOlder