Skip to content

Instantly share code, notes, and snippets.

View jpemberthy's full-sized avatar

Juan Pemberthy jpemberthy

View GitHub Profile
(function($) {
$.fn.formatCurrency = function(settings) {
settings = jQuery.extend({
name: "formatCurrency",
useHtml: false,
global: true
}, settings);
return this.each(function() {
$("#emForm input.number").keypress(function(e) {
if (48 < e.which && e.which > 57) {
return false;
}
});
class ReportsController < ApplicationController
def index
#creating a column3D chart.
@col3d = Ezgraphix::Graphic.new(:div_name => 'columnd3d', :c_type => 'col3d')
@col3d.data = {:usa => 306173000, :uk => 60975000, :brazil => 190467249, :russia => 142008838}
@col3d.render_options(:w => 400, :y_name => 'Population/Millions')
#creating a pie3D chart.
@pie3d = Ezgraphix::Graphic.new(:div_name => 'pie3d', :c_type => 'pie3d', :w => 400, :data => @col3d.data)
<div class="span-10 colborder">
<h6>Rendering a Column 3D</h6>
<%= render_ezgraphix @col3d %>
</div>
<div class="span-10 last">
<h6>Rendering a Pie 3D</h6>
<%= @pie3d %>
</div>
#<fatal: exception reentered>
#<Mysql::Error: MySQL server has gone away>
#<ActiveRecord::StatementInvalid: Mysql::Error: MySQL server has gone away: SELECT * FROM `posts` WHERE (`post`.`title` = 'hello world') LIMIT 1>
>> server_time = Time.now
=> Sat Feb 14 17:44:48 +0000 2009
>> col_time #returns the current Colombian Time
=> Sat Feb 14 12:45:02 UTC 2009
>> col_time > server_time # It should be true!
=> false
# Colombia to Server Time
>> col_to_utc = TZInfo::Timezone.get('America/Bogota').local_to_utc(col_time)
=> Sat Feb 14 17:45:02 UTC 2009
>> col_to_utc > server_time #now It should be true!
environment: production
chdir: /home/acoplet/www/acoplet/current/
address: 127.0.0.1
user: acoplet
group: acoplet
port: 8000
pid: /home/acoplet/www/acoplet/current/tmp/thin.pid
rackup: /home/acoplet/www/acoplet/current/config.ru
log: /home/acoplet/www/acoplet/current/log/thin.log
max_conns: 1024
load 'deploy' if respond_to?(:namespace)
set :application, "acoplet"
set :user, "acoplet"
set :use_sudo, false
set :scm, :git
set :repository, "git@github.com:jpemberthy/acoplet.git"
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{user}/www/#{application}"
require 'rubygems'
require 'sinatra'
set :environment, :production
set :port, 8000
disable :run, :reload
require 'acoplet'
run Sinatra::Application
require 'rubygems'
require 'sinatra'
Sinatra::Application.default_options.merge!(
:run => false,
:env => :production
)
require 'acoplet'
run Sinatra.application