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
| ## Rails Upgrade check | |
| # | |
| # Check your github repos for out of date rails apps | |
| # | |
| # usage: $ ENV=yourusername PASSWORD=yourpassword ruby railscheck.rb | |
| # or | |
| # usage: $ ENV=yourusername PASSWORD=yourpassword ORG=yourorgname ruby railscheck.rb | |
| # | |
| # n.b requires the octokit gem |
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 'uri' | |
| if ENV.has_key? "BUCKET_URL" | |
| uri = URI.parse(ENV["BUCKET_URL"]) | |
| ENV["S3_ACCESS_KEY"] = uri.user | |
| ENV["S3_ACCESS_SECRET"] = uri.password | |
| 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
| class ContactsController < ApplicationController | |
| def create | |
| @contact = Contact.new(params[:contact]) | |
| if @contact.valid? | |
| ContactMailManager.delay.send_contact_mail(@contact) | |
| redirect_to contact_path(1), :notice => t("contact.sent") | |
| else | |
| ... | |
| 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
| unless MyModel::Translation.column_names.map(&:to_sym).include?(:new_attrib) | |
| add_column MyModel::Translation.table_name, :new_attrib, :string | |
| 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
| ActionView::Template::Error (Can't mass-assign protected attributes: locale): | |
| 1: <div id='recent_activity'> | |
| 2: <h2><%= t('.latest_activity') %></h2> | |
| 3: <% if (activity = @recent_activity.collect { |a| | |
| 4: activity_message_for(a) | |
| 5: }.reject(&:blank?)).present? %> | |
| 6: <ul class='clickable'> | |
| 7: <% activity.each do |message| %> | |
| activemodel (3.2.8) lib/active_model/mass_assignment_security/sanitizer.rb:48:in `process_removed_attributes' | |
| activemodel (3.2.8) lib/active_model/mass_assignment_security/sanitizer.rb:20:in `debug_protected_attribute_removal' |
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
| create table johns_problem as | |
| select distinct trim(name) as name | |
| from drugs | |
| where customer_id IS NOT NULL | |
| order by name; | |
| select distinct name from drugs | |
| -- delete table johns_problem |
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
| @report = Reports::BusinessIntelligenceReport.new | |
| @report.customer_id = customer_id.to_i | |
| @report.start_date = Date.strptime(start_date, "%m/%d/%Y") | |
| @report.end_date = Date.strptime(end_date, "%m/%d/%Y") | |
| attachments['business_intelligence_report.csv'] = @report.to_csv | |
| mail(to: email, subject: "Business Intelligence Report") do |format| | |
| format.text | |
| 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
| rgb(39,39,39) => #272727 | |
| rgb(40,40,40) => #282828 | |
| rgb(41,41,41) => #292929 | |
| rgb(43,43,43) => #2b2b2b | |
| rgb(44,44,44) => #2c2c2c | |
| rgb(46,46,46) => #2e2e2e | |
| rgb(49,49,49) => #313131 | |
| rgb(50,50,50) => #323232 | |
| rgb(52,52,52) => #343434 | |
| rgb(53,53,53) => #353535 |
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
| " use Ctrl+L to toggle the line number counting method | |
| function! g:ToggleNuMode() | |
| if(&rnu == 1) | |
| set nu | |
| else | |
| set rnu | |
| endif | |
| endfunc | |
| nnoremap <C-L> :call g:ToggleNuMode()<cr> |
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
| DROP TABLE IF EXISTS soc; | |
| DROP TABLE IF EXISTS pt; | |
| DROP TABLE IF EXISTS llt; | |
| CREATE TABLE soc ( | |
| soc_code BIGINT constraint ix1_soc01 PRIMARY KEY, | |
| soc_name varchar(100) constraint ix1_soc02 NOT NULL, | |
| soc_abbrev varchar(5) NOT NULL, | |
| soc_whoart_code varchar(7), | |
| soc_harts_code BIGINT, |