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 AddProfileIdToTestimonials < ActiveRecord::Migration | |
| def change | |
| add_column :testimonials, :profile_ids, :integer, array: true | |
| reversible do |dir| | |
| dir.up do | |
| execute <<-SQL | |
| update testimonials set profile_ids = (select array_agg(profiles.id) from profiles | |
| where profiles.accounts_id = testimonials.account_id;) | |
| SQL |
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
| UPDATE call_source_partners | |
| SET affiliate_slug = params->>'affiliate_slug', category_id = (params->>'category_id')::integer; | |
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
| #! /usr/bin/env ruby -rruby-prof | |
| # Profile the code | |
| RubyProf.start | |
| load "#{ENV['PWD']}/config/environment.rb" | |
| result = RubyProf.stop | |
| # Print a flat profile to text | |
| printer = RubyProf::FlatPrinter.new(result) | |
| printer.print(STDOUT) |
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
| - if @profile.locations.empty? | |
| .info-col.padding-sidegap10 | |
| %ul.unstyled | |
| %li No Locations Specified | |
| - elsif @profile.is_dynamic | |
| .info-col | |
| .alert.margin-topgap5.padding-gap10 | |
| %p.margin-gap0.dynamic-text | |
| %span.inline-block You have chosen to display a dynamic serving area. | |
| %br |
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
| location ~* "^.*?\.(eot)|(ttf)|(woff)$" { | |
| add_header Access-Control-Allow-Origin *; | |
| } |
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
| <Directory "/opt/bitnami/apps/wordpress/htdocs"> | |
| Options +MultiViews +FollowSymLinks | |
| AllowOverride None | |
| <IfVersion < 2.3 > | |
| Order allow,deny | |
| Allow from all | |
| </IfVersion> | |
| <IfVersion >= 2.3> | |
| Require all granted | |
| </IfVersion> |
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 'formula' | |
| def raster? | |
| ARGV.include? '--with-raster' | |
| end | |
| def topology? | |
| ARGV.include? '--with-topology' | |
| 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
| #!/usr/bin/env ruby | |
| TEAM_COUNT = 7 | |
| PLAYERS = 5 | |
| ITERATIONS = 1_000_000 | |
| PLAYERS_TO_DRAFT = 7 | |
| # Players available to draft are numbered 1..Total # | |
| # we are only looking at the first PLAYERS number | |
| AVAILABLE_PLAYERS_ARRAY = (1..TEAM_COUNT * PLAYERS_TO_DRAFT).to_a |
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
| protected | |
| def bot? | |
| # Simple check to match if the user agent is a bot. We look for anything | |
| # that has the pattern bot/ (e.g. Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)) | |
| # or that does not start with Mozilla / Opera (e.g. AdsBot-Google (+http://www.google.com/adsbot.html)) | |
| # This could probably be combined in to one regex, but couldn't figure out how to do it quickly. | |
| %r[bot/] =~ request.user_agent || %r{^(?!Mozilla|Opera)} =~ request.user_agent | |
| 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
| RAILS_PAGER='less' | |
| rl() { | |
| if [[ $RAILS_PAGER == "less" ]] ; then | |
| MODES="-R" | |
| else | |
| MODES="-f" | |
| fi | |
| if [[ $RAILS_ENV != "" ]] ; then | |
| $RAILS_PAGER $MODES log/$RAILS_ENV.log; |