I hereby claim:
- I am slamotte on github.
- I am slamotte (https://keybase.io/slamotte) on keybase.
- I have a public key ASBbxep9xuJGTzh756X41RN_Vnri1fE5Wswv9a8wL4dpZAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| require 'net/ldap' | |
| LDAP_Servers_Transit = ['trn02svpdc01', 'trn02svpdc02'] | |
| LDAP_Servers_Corporate = ['cowsvpdc01', 'cowsvpdc02', 'cowsvpdc03', 'cowsvpdc04', 'cowsvpdc05'] | |
| def authenticate(user_name, password, ldap_servers = LDAP_Servers_Transit, port = 389) | |
| ldap_servers.each do |server| | |
| begin | |
| # Try to connect to the LDAP server as the user | |
| ldap = Net::LDAP.new( {:host => server, :port => port, :auth => { :method => :simple, :username => user_name, :password => password }} ) |
| # The loaded? method doesn't factor in permanent_record's deleted_at column, so let it. Otherwise we can't log in! | |
| module ActiveRecord | |
| class SessionStore | |
| class Session | |
| def loaded_with_permanent_record? | |
| loaded_without_permanent_record? || respond_to?(:deleted_at) && deleted_at.present? | |
| end | |
| alias_method_chain :loaded?, :permanent_record | |
| end |
| module ShallowNestedRoutes | |
| def self.included(base) | |
| base.extend(ClassMethods) | |
| end | |
| module ClassMethods | |
| # Pass in the name of the parent class | |
| def set_shallow_nested_route_parent(parent) | |
| parent = parent.to_s | |
| # Override these methods so they set the prefix path before a call and reset it afterward. |
| if process_all | |
| groups << %w(country province town) | |
| groups << %w(job_class job_skill experience_level) | |
| groups << %w(local collective_agreement due_type batch_due_type due_type_amount) | |
| groups << %w(award course member_status project other_company) | |
| groups << %w(member member_award member_course member_transfer member_auto_status_change member_experience_level member_job_skill member_movement) | |
| groups << %w(out_of_work_list out_of_work_list_check_in out_of_work_list_job_class out_of_work_list_excluded_job_skill) | |
| groups << %w(company company_collective_agreement field_office dispatch_request member_collective_agreement other_company_employment project_attribute employment employment_job_skill) | |
| groups << %w(payment_batch payment_batch_receipt payment_batch_receipt_print deposit payment_batch_deposit payment_batch_member payment_batch_member_due due_transaction member_arrears) | |
| groups << {class_name: "address", tables: %w(member company)} |
| require 'spec_helper' | |
| describe Town do | |
| subject { create(:town) } | |
| it "has a valid factory" do | |
| subject.should be_valid | |
| end | |
| it "is invalid without a name" do |
| var x = new HttpRequest(); | |
| x.open("GET", "http://10.0.0.82:2000/WCFServicePropertyControl/WCFServicePC.svc?wsdl", false); | |
| x.send(null); |
| # WIP: create a proxy method for the MS Govern WS | |
| require 'open-uri' | |
| [:get, :post].each do |method| | |
| send method, '/soap-proxy' do | |
| open("http://padsvd02.ad.cityofwpg.org/#{}") | |
| end | |
| end |
| alter table t add c2 varchar2(4000); | |
| update t set c2 = c; | |
| update t set c = null; | |
| commit; | |
| alter table t modify c long; | |
| alter table t modify c clob; | |
| update t set c = c2; | |
| alter table t drop column c2; | |
| commit; |
| #!/bin/bash | |
| # | |
| # Startup script for Oracle databases | |
| export ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/db_1 | |
| export PATH=$PATH:$ORACLE_HOME/bin | |
| export TZ=CST6 | |
| function process_oem() { | |
| egrep -v '^([:space:]*#|[:space:]*$)' /etc/oratab | egrep 'Y$' | sed "s/:.*//" | while read sid; do |