This file contains hidden or 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
# https://github.com/wallace/resque-lonely_job/blob/master/lib/resque-lonely_job.rb#L34-L42 | |
def before_perform(*args) | |
unless can_lock_queue?(*args) | |
# can't get the lock, so re-enqueue the task | |
reenqueue(*args) | |
# and don't perform | |
raise Resque::Job::DontPerform | |
end | |
end |
This file contains hidden or 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 'rho/rhoapplication' | |
require 'rho/rhoutils' | |
class AppApplication < Rho::RhoApplication | |
def initialize | |
# Tab items are loaded left->right, @tabs[0] is leftmost tab in the tab-bar | |
# Super must be called *after* settings @tabs! | |
@tabs = nil | |
#To remove default toolbar uncomment next line: | |
#@@toolbar = nil |
This file contains hidden or 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
# Otherwise you can specify a style for each column. | |
ws.add_row ['Q1-2011', '26740000000', '=B5/SUM(B4:B7)'], :style => [pascal, money_pascal, percent_pascal] | |
ws.add_row ['Q1-2012', '46330000000', '=B6/SUM(B4:B7)'], :style => [default, money, percent] | |
ws.add_row ['Q1-2013(est)', '72230000000', '=B7/SUM(B4:B7)'], :style => [default, money, percent] | |
# You can merge cells! | |
ws.merge_cells 'A1:C1' | |
end | |
end |
This file contains hidden or 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
wb.add_worksheet(:name => 'Data Bar Conditional Formatting') do |ws| | |
ws.add_row ['A$$le Q1 Revenue Historical Analysis (USD)'], :style => title | |
ws.add_row | |
ws.add_row ['Quarter', 'Profit', '% of Total'], :style => header | |
# Passing one style applies the style to all columns | |
ws.add_row ['Q1-2010', '15680000000', '=B4/SUM(B4:B7)'], :style => pascal |
This file contains hidden or 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
p.workbook do |wb| | |
# define your regular styles | |
styles = wb.styles | |
title = styles.add_style :sz => 15, :b => true, :u => true | |
default = styles.add_style :border => Axlsx::STYLE_THIN_BORDER | |
pascal_colors = { :bg_color => '567DCC', :fg_color => 'FFFF00' } | |
pascal = styles.add_style pascal_colors.merge({ :border => Axlsx::STYLE_THIN_BORDER, :b => true }) | |
header = styles.add_style :bg_color => '00', :fg_color => 'FF', :b => true | |
money = styles.add_style :format_code => '#,###,##0', :border => Axlsx::STYLE_THIN_BORDER | |
money_pascal = styles.add_style pascal_colors.merge({ :format_code => '#,###,##0', :border => Axlsx::STYLE_THIN_BORDER }) |
This file contains hidden or 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 'axlsx' | |
p = Axlsx::Package.new | |
# Required for use with numbers | |
p.use_shared_strings = true |
This file contains hidden or 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
# adapted from http://axlsx.blogspot.com/, https://gist.github.com/2484520 | |
require 'axlsx' | |
p = Axlsx::Package.new | |
# Required for use with numbers | |
p.use_shared_strings = true | |
p.workbook do |wb| | |
# define your regular styles | |
styles = wb.styles |
This file contains hidden or 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 'axlsx' | |
p = Axlsx::Package.new | |
p.workbook do |wb| | |
# define your regular styles | |
styles = wb.styles | |
title = styles.add_style :sz => 15, :b => true, :u => true | |
default = styles.add_style :border => Axlsx::STYLE_THIN_BORDER | |
header = styles.add_style :bg_color => '00', :fg_color => 'FF', :b => true | |
money = styles.add_style :format_code => '#,###,##0', :border => Axlsx::STYLE_THIN_BORDER | |
percent = styles.add_style :num_fmt => Axlsx::NUM_FMT_PERCENT, :border => Axlsx::STYLE_THIN_BORDER |
This file contains hidden or 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
5 min: | |
~Objective-C + Rails: | |
Communicating w/rails from iOS/mac OS | |
Dan Hassin | |
1 min: | |
~Painless Javascript | |
koting hatduklgg | |
with wind tunnel |
This file contains hidden or 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
1 min: | |
~Painless Javascript | |
koting hatduklgg | |
with wind tunnel | |
~tenderlove.dup jremsikjr | |
~iwanttolearnruby.com | |
(collecting resources for learning ruby) |