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
javascript:(function(){document.getElementById("content").style.cssText = "display:block";document.getElementById("mw-sopaOverlay").style.cssText = "display:none";})(); |
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 'csv' | |
def transform_merge(csv_file) | |
CSV.open(@csv_file).read.each do |line| | |
end | |
end | |
def multiple_merge(inputs) | |
errors = [] |
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
def merge(user1, user2, preferred_email) | |
raise "Email cannot be the same" if (user1 == user2) | |
u = User.unscoped.find_by_email(user1) | |
u2 = User.unscoped.find_by_email(user2) | |
raise "User1 not found" if u.nil? | |
raise "User2 not found" if u2.nil? | |
if u.alternate_ids.empty? |
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
log = Logger.new("/tmp/whos_behind.log") | |
log.info "Producer Number, Full Name, Email, Party Key, Agency Status, Personal Status, Completed Elective Points, Outstanding Essentials" | |
Certification.where(["code IN(?)", [:agent, :lsp]]).each do |certification| | |
certification.users.limit(10).each do |user| | |
if user.party_type == 'Agent' | |
organization = user.organization | |
agency_status = organization.status |
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
module Owner | |
class Response | |
def each | |
10.times do |i| | |
yield("entry #{i}\n") | |
sleep 1 | |
end | |
end | |
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
// (c) 2010 Cameron Westland, Big Bang Technology Inc. | |
// Backbone may be freely distributed under the MIT license. | |
// For all details and documentation: | |
// http://bigbangtechnology.github.com/stately | |
/** | |
Example: | |
var MyView = Backbone.View.extend(Stately).extend({ | |
states: { | |
EDITING: "editing", |
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 ReportsController < ApplicationController | |
rescue_from ArgumentError, :with => :invalid_report | |
before_filter :require_user | |
def show | |
respond_to do |wants| | |
wants.json { render :json => UserReportFactory.get_report( current_user, params[:id] ), :status => :ok } | |
wants.csv { | |
filename = "woople_#{params[:id]}.csv" |
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
ActiveRecord::Schema.define(:version => 20100527145216) do | |
create_table "access_rights", :force => true do |t| | |
t.integer "group_id", :null => false | |
t.integer "restrictable_id" | |
t.string "restrictable_type" | |
t.datetime "created_at" | |
t.datetime "updated_at" | |
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
+--------------------+--------+---------+------------+------+----------------+-------------+-------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+-------------------+ | |
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | | |
+--------------------+--------+---------+------------+------+----------------+-------------+-------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+-------------------+ | |
| access_rights | InnoDB | 10 | Compact | 1 | 16384 | 16384 | 0 | 16384 | 0 | 89 | |
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
PASSWORD = lambda { |login| | |
Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--")[0,8] | |
} | |
PASSWORD.call("username") |