Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
gem "rspec", "=1.2.8"
require 'selenium/client'
require 'selenium/rspec/spec_helper'
describe "Login Window" do
attr_reader :selenium_driver
before(:all) do
<html>
<head>
</head>
<body>
<table id="mapping">
<tr>
<td>bangkok</td>
<td>http://wikipedia.org/wiki/Thailand</td>
</tr>
<tr>
import org.springframework.beans.factory.InitializingBean
import org.zeromq.ZMQ
class ParseService implements InitializingBean {
def pullSocket
def pubSocket
def running = true
def pollingRate = 200
require 'webrick'
include WEBrick
def start_webrick(config = {})
# always listen on port 8080
config.update(:Port => 8081)
server = HTTPServer.new(config)
yield server if block_given?
['INT', 'TERM'].each {|signal|
# process the PayPal <span class="caps">IPN POST</span>
def paypal_ipn
if @request.method == :post
# use the POSTed information to create a call back URL to PayPal
@query = ‘cmd=_notify-validate’
@request.params.each_pair {|key, value| @query = @query + ’&’ + key + ’=’
+ value.first if key != ‘register/pay_pal_ipn.html/pay_pal_ipn’ }
http = Net::HTTP.start(PAYPAL_URL, 80)
@pphetra
pphetra / gist:1172924
Created August 26, 2011 07:43
google script
function createOrClearSheet2() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
if (sheets.length == 1) {
ss.insertSheet('output');
}
var output_sheet = ss.getSheetByName('output');
output_sheet.clear();
copyContentToOutput(sheets[0], output_sheet);
description "Request an interest rate from interest service"
before "prepare helper function", {
prepareRate = { params->
}
date = { str ->
db.open(createCollection)
function createCollection(err, client) {
client.createCollection('docs', insertData)
}
function insertData(err, col) {
for (var i = 0; i < 100; i++) {
col.insert({c: i}, function() {})
}
@pphetra
pphetra / gist:3304196
Created August 9, 2012 13:30
Ext.ux.DataView.LabelEditor
/**
* @class Ext.ux.DataView.LabelEditor
* @extends Ext.Editor
*/
Ext.define('Ext.ux.DataView.LabelEditor', {
extend: 'Ext.Editor',
alignment: 'tl-tl',
@pphetra
pphetra / css
Created August 9, 2012 13:41
todo2
<style>
.x-item-selected {
background: #eeffaa;
}
body {
padding: 20px;
}
#todoTxt {
margin-bottom: 20px;
}