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
# -*- encoding : utf-8 -*- | |
module AsyncResque | |
extend ActiveSupport::Concern | |
included do | |
include Sidekiq::Worker | |
def perform(*args) | |
self.class.find(args.first).send(args.last) | |
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
# put this file in any autoloaded path on rails app. HINT: app/inputs/check_boxes_input.rb | |
class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput | |
def to_html | |
unless options[:nested_set] | |
super | |
else | |
nested_wrapping(options) | |
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
# comment out "deploy/assets" in your capfile, we are doing this locally | |
namespace :noumad do | |
desc "Compress assets in a local file" | |
task :compress_assets do | |
run_locally("rm -rf public/assets/*") | |
run_locally("bundle exec rake assets:precompile") | |
run_locally("touch assets.tgz && rm assets.tgz") |
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
Uploadizr = $.klass({ | |
initialize: function(submiter , path ){ | |
//console.log("picker!! " +submiter+" "+$(this.element).attr("token")+" "+path); | |
var current_id = ""; | |
var token = $(this.element).attr("token") | |
var uploader = new plupload.Uploader({ | |
runtimes : "html5", | |
browse_button : $(this.element).attr("id"), | |
max_file_size : '10mb', | |
url : path, |
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
ENV["PATH"] = "/opt/ruby/bin:#{ENV['PATH']}" | |
ENV["RAILS_ENV"] = "production" | |
ENV["QUEUE"] = "*" | |
Bluepill.application("nichelator") do |app| | |
app.working_dir = "/var/apps/nichelator/current" | |
app.uid = "app" | |
app.gid = "app" | |
2.times do |i| | |
app.process("resque-#{i}") do |process| |
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
##### controllers | |
@time_chart = HighChart.new('chart_tag') do |f| | |
f.chart({:zoomType =>'x', :defaultSeriesType => 'spline'}) | |
f.title(:text => 'Flower Market') | |
f.x_axis({:type =>'datetime'}) | |
f.y_axis({:title => 'flowers'}) | |
chart_begin_js = "Date.UTC(#{@last_x_days[0].year}, #{@last_x_days[0].month-1}, #{@last_x_days[0].day})" | |
f.series(:name => 'violets', :data => generate_numbers(number), :pointInterval => 24*3600*1000) | |
f.series(:name => 'sunflowers', :data => generate_numbers(number), :pointInterval => 24*3600*1000) | |
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 'net/pop' | |
module Mailman | |
class Receiver | |
# Receives messages using POP3, and passes them to a {MessageProcessor}. | |
class POP3 | |
# @return [Net::POP3] the POP3 connection | |
attr_reader :connection |
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
// togglea values de inputs | |
InputValueHelper = $.klass({ | |
initialize: function(){ | |
this.initial_value = $(this.element).val() | |
}, | |
onblur: function(){ | |
if($(this.element).val() == '') { | |
$(this.element).val(this.initial_value); | |
} |
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
# ---------------------------------------------- | |
# Class for Youtube (youtube.com) | |
# http://www.youtube.com/watch?v=25AsfkriHQc | |
# ---------------------------------------------- | |
class VgVimeo | |
def initialize(url=nil, options={}) | |
# general settings |