This file contains 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 'rubygems' | |
require 'net/ssh/gateway' | |
begin | |
archi_gateway = Net::SSH::Gateway.new('app.archisnapper.com', 'zorros') | |
p1 = archi_gateway.open('127.0.0.1', 3306, 3307) | |
safety_gateway = Net::SSH::Gateway.new('app.safetysnapper.com', 'zorros') | |
p2 = safety_gateway.open('127.0.0.1', 3306, 3308) | |
puts "Opened gateways on port: #{p1},#{p2}" |
This file contains 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 UsersMailer < BaseMailer | |
def welcome user | |
@user = user | |
LocaleSaver.use_user_or_default_locale(user) do | |
mail to: @user.email, | |
from: email_sender_for_current_locale, | |
subject: t("users_mailer.welcome.subject") do |format| | |
format.html {render "welcome"} | |
end |
This file contains 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 ReportDownloadsController < InheritedResources::Base | |
actions :new, :create, :show | |
before_filter :build_report_download, except: :show | |
def create | |
if @report_download.save | |
ReportDownloadsMailer.sample_report_pdf_link(@report_download).deliver | |
render "thanks" | |
else |
This file contains 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
.spider.graph_data.hide | |
:ruby | |
{ chart: { polar: true }, | |
title: { text: t("spider_graph_for") }, | |
pane: { size: "80%" }, | |
xAxis: { categories: group.questions.map(&:unique_id), tickmarkPlacement: 'on', lineWidth: 0 }, | |
yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, min: 0 }, | |
series: [ {name: t("people_average"), | |
data: group.questions.map(&:average), | |
pointPlacement: 'on'}, |
This file contains 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
#!/usr/bin/env ruby | |
require 'mail' | |
require 'csv' | |
require 'nokogiri' | |
CSV.open 'emails.csv', 'wb' do |csv| | |
Dir.glob('*.eml').each do |mail_file| | |
mail = Mail.read mail_file |
This file contains 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 "mysql2" | |
require 'csv' | |
class MissingAttendees | |
CSV_FILE_NAME = "#{Rails.root}/db/emails.csv" | |
def self.fix_list! | |
MissingAttendees.new.fix_list | |
end |
This file contains 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
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
call_without_quiet_assets(env).tap do | |
Rails.logger.level = previous_level | |
end | |
end | |
alias_method_chain :call, :quiet_assets |
This file contains 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
!!! | |
%html | |
%head | |
%style{type:'text/css'} | |
= Fikket::Application.assets.find_asset('email.css').body | |
%meta{charset:'utf-8'} | |
%body.ticket_pdf | |
%table | |
%tbody | |
%tr |
This file contains 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
$flash_width: 400px; | |
$distance_from_relative_anchor: 65px; | |
$left_offset: 0 - $flash_width / 2; | |
.flash_container { | |
position: absolute; | |
top: $distance_from_relative_anchor; | |
left: 50%; | |
width: $flash_width; | |
margin: {left: $left_offset;} |
This file contains 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 | |
#creates FB test users and stores their data in a YML file | |
task :create_and_load_facebook_test_users => :environment do | |
require 'koala' | |
@@file_name = "db/fb_test_users.yaml" | |
#FB doesn't allow integers on user names, so we need to create names like "user_aa", "user_ab", etc. | |
def next_name(player_number) | |
first_letter = ((player_number / 24).to_i + 97).chr |
NewerOlder