Skip to content

Instantly share code, notes, and snippets.

source 'https://rubygems.org'
gem 'sinatra'
gem 'active_support'
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3914566-6', 'auto');
ga('send', 'pageview');
</script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://putsbox.com" />
<title>Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@phstc
phstc / ItemQueryRqSoapImpl.java
Created November 17, 2010 19:22
QuickBooks Web Connector QWC implementation in Java
package com.cantero.quickbooks.ws;
import java.util.ArrayList;
import javax.jws.WebService;
/*
* http://developer.intuit.com/qbsdk-current/doc/pdf/qbwc_proguide.pdf
*/
@WebService(endpointInterface = "com.cantero.ws.client.QBWebConnectorSvcSoap")
@phstc
phstc / geokit_monkey_patch.rb
Created November 23, 2010 21:07
Geokit monkey patch to work with rails 3.0.3, ruby 1.9.2p0
#Apply this monkey patch in your application.rb
#See: https://github.com/andre/geokit-gem/issues#issue/7
module Geokit
require 'uri'
module Geocoders
class Geocoder
def self.logger()
if Geokit::Geocoders::logger.nil?
Geokit::Geocoders::logger = Logger.new(STDOUT)
Geokit::Geocoders::logger.level=Logger::DEBUG
public interface Dao {}
public class JpaDao implements Dao {}
public class ProductService {
private Dao dao;
public ProductService(Dao dao){
this.dao = dao;
}
}
@phstc
phstc / isFollowing.js
Created December 17, 2010 00:38
isFollowing Bookmarklet – Who is following who?
javascript:(function(){
/*@author Pablo Cantero - http://pablocantero.com/blog/2010/12/20/isfollowing-bookmarklet-who-is-following-who*/
var isFollowing = function(twitterScreenNameA, twitterScreenNameB){
jQuery.getJSON('http://twitter.com/statuses/followers.json?screen_name=' + twitterScreenNameA + '&callback=?', function(data){
for(var i = 0; i < data.length; i++){
if(data[i].screen_name === twitterScreenNameB.replace('@', '')){
alert(twitterScreenNameB + ' is following ' + twitterScreenNameA);
return;
}
}
/*
@pablocantero
http://pablocantero.com
https://github.com/phstc/jquery-twitter/
*/
(function(){
/*
Customized callback to show an error message on the tweets's lookup
This callback is optional, the default error callback shows an alert(errorMessage)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="https://github.com/phstc/jquery-twitter/raw/master/src/jquery.twitter.js"></script>
<script>
/*
@pablocantero
http://pablocantero.com
pt-BR:
errors:
messages:
not_found: 'não encontrado'
already_confirmed: 'já foi confirmado'
not_locked: 'não foi bloqueado'
not_saved:
one: '1 erro impediu que %{resource} fosse gravado:'
other: '%{count} erros impediram que %{resource} fosse gravado:'