Skip to content

Instantly share code, notes, and snippets.

View workmaster2n's full-sized avatar

Tyler DeWitt workmaster2n

  • Peritus Resource Group
  • Tulsa, OK
View GitHub Profile
@workmaster2n
workmaster2n / error output
Created March 28, 2012 21:39
Error when deploying bootstrapped app with capistrano
* executing `deploy:assets:precompile'
* executing "cd /var/www/CollegeSportsBlueBook/releases/20120328212148 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["www.wow.weaponxo.com"]
[www.wow.weaponxo.com] executing command
*** [err :: www.wow.weaponxo.com] rake aborted!
*** [err :: www.wow.weaponxo.com] Undefined variable: "$baseLineHeight".
*** [err :: www.wow.weaponxo.com] (in /var/www/CollegeSportsBlueBook/shared/bundle/ruby/1.9.1/gems/bootstrap-sass-2.0.1/vendor/assets/stylesheets/bootstrap/_accordion.scss)
*** [err :: www.wow.weaponxo.com]
*** [err :: www.wow.weaponxo.com] Tasks: TOP => assets:precompile:primary
*** [err :: www.wow.weaponxo.com] (See full trace by running task with --trace)
@workmaster2n
workmaster2n / application.rb
Created March 29, 2012 03:42
Error when trying to precompile assets
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
@workmaster2n
workmaster2n / deploy.rb
Created April 4, 2012 00:15
pretend deploy.rb
before 'deploy:setup', 'rvm:install_rvm'
before 'deploy:setup', 'rvm:install_ruby'
@workmaster2n
workmaster2n / .bashrc
Created April 4, 2012 00:47
where do we load rvm
if [[ -n "$PS1" ]]; then
...
OTHER STUFF
...
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
fi
@workmaster2n
workmaster2n / edit.html.erb
Created April 5, 2012 02:15
ActiveSupport::HashWithIndifferentAccess Error
<h1>PlayersToTeams#edit</h1>
<%= form_for @players_to_teams do |field| %>
<%= field.fields_for @players_to_teams.player do |f| %>
<%= f.label :IsActive %>
<%= f.text_field :IsActive %>
<% end %>
<%= field.label :BT %>
<%= field.text_field :BT %>
<br/>
<%= field.submit "Save", class: 'btn btn-primary' %>
@workmaster2n
workmaster2n / error
Created April 10, 2012 23:25
rails 3 and jQuery UI Slider
GET http://10.1.10.100:3000/images/ui-bg_inset-hard_100_fcfdfd_1x100.png 404 (Not Found)
GET http://10.1.10.100:3000/assets/images/ui-bg_glass_45_0078ae_1x400.png 404 (Not Found)
+-----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| IsActive | tinyint(1) | YES | | NULL | |
| IsVisible | tinyint(1) | YES | | NULL | |
| player_id | int(11) | YES | | NULL | |
| team_id | int(11) | YES | | NULL | |
| CreationDate | varchar(255) | YES | | NULL | |
| Position | varchar(255) | YES | | NULL | |
@workmaster2n
workmaster2n / EXPLAIN SELECT
Created April 11, 2012 22:42
slow order by
+----+-------------+----------+--------+---------------------+---------+---------+------------------------------------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+--------+---------------------+---------+---------+------------------------------------+-------+---------------------------------+
| 1 | SIMPLE | teams | ALL | fk_teams_account_id | NULL | NULL | NULL | 15707 | Using temporary; Using filesort |
| 1 | SIMPLE | accounts | eq_ref | PRIMARY | PRIMARY | 4 | mysql_development.teams.account_id | 1 | |
+----+-------------+----------+--------+---------------------+---------+---------+------------------------------------+-------+---------------------------------+
2 rows in set (0.00 sec)
@workmaster2n
workmaster2n / accounts
Created April 12, 2012 16:33
Confused as to the difference in speeds of these 2 queries
28,444 records
mysql> SHOW CREATE TABLE accounts\G
*************************** 1. row ***************************
Table: accounts
Create Table: CREATE TABLE `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`AccountId` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`AccountIdTemp` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`HighSchoolTempId` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
mysql> EXPLAIN EXTENDED SELECT `players_to_teams`.`id` AS t0_r0, `players_to_teams`.`IsActive` AS t0_r1, `players_to_teams`.`IsVisible` AS t0_r2, `players_to_teams`.`player_id` AS t0_r3, `players_to_teams`.`team_id` AS t0_r4, `players_to_teams`.`CreationDate` AS t0_r5, `players_to_teams`.`Position` AS t0_r6, `players_to_teams`.`Number` AS t0_r7, `players_to_teams`.`Club` AS t0_r8, `players_to_teams`.`BT` AS t0_r9, `players_to_teams`.`BioLink` AS t0_r10, `players_to_teams`.`OtherBioLink` AS t0_r11, `players_to_teams`.`StartYear` AS t0_r12, `players_to_teams`.`EndYear` AS t0_r13, `players_to_teams`.`NeulionPlayerID` AS t0_r14, `players_to_teams`.`SeasonYear` AS t0_r15, `players_to_teams`.`GamesPlayed` AS t0_r16, `players_to_teams`.`created_at` AS t0_r17, `players_to_teams`.`updated_at` AS t0_r18, `players_to_teams`.`account_id` AS t0_r19, `players_to_teams`.`account_name` AS t0_r20, `players`.`id` AS t1_r0, `players`.`IsActive` AS t1_r1, `players`.`IsVisible` AS t1_r2, `players`.`FirstName` AS t1_r3, `players`.