$ rails g model User
belongs_to
has_one
| Tested on: Datatable 1.8.2, Rails 3.1.3 | |
| This example uses Coffeescript and Haml (you should too :-) ) | |
| The following is an example of Datatables server-side processing of a table | |
| which displays a user's song list including the songs' artist names. In | |
| Rails, Song and Artist are ActiveRecord models in a one artist-many song relat. | |
| 1a. the Rails controller code | |
| class SongsController < ApplicationController |
| Get the Heroku db as detailed here: | |
| http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup | |
| 1. heroku pgbackups:capture | |
| 2. heroku pgbackups:url <backup_num> #=>backup_url | |
| - get backup_num with cmd "heroku pgbackups" | |
| 3. curl -o latest.dump <backup_url> | |
| Then locally do: | |
| $ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.
Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb to comment out the faulty Windows check and add a real SSH check:
# if Util::Platform.windows?
# raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
# :port => ssh_info[:port],
# :username => ssh_info[:username],
# :key_path => ssh_info[:private_key_path]| $.fn.parsley.defaults = { | |
| // basic data-api overridable properties here.. | |
| inputs: 'input, textarea, select' // Default supported inputs. | |
| , excluded: 'input[type=hidden], :disabled' // Do not validate input[type=hidden] & :disabled. | |
| , trigger: false // $.Event() that will trigger validation. eg: keyup, change.. | |
| , animate: true // fade in / fade out error messages | |
| , animateDuration: 300 // fadein/fadout ms time | |
| , focus: 'first' // 'fist'|'last'|'none' which error field would have focus first on form validation | |
| , validationMinlength: 3 // If trigger validation specified, only if value.length > validationMinlength | |
| , successClass: 'has-success' // Class name on each valid input |
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
#
# Automounter master map
#
+auto_master # Use directory service
| # METEOR CORE: | |
| Anywhere: Meteor.isClient | |
| Anywhere: Meteor.isServer | |
| Anywhere: Meteor.startup(func) | |
| Anywhere: Meteor.absoluteUrl([path], [options]) | |
| Anywhere: Meteor.settings | |
| Anywhere: Meteor.release | |
| # A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
| # Check our Studio: https://gentlenode.com/ | |
| meteor add iron:router | |
| meteor update iron:router | |
| # Iron Router > Configuration |
| #!/bin/sh | |
| base=$1 | |
| convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png" | |
| convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png" | |
| convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png" | |
| convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png" | |
| convert "$base" -resize '58x58' -unsharp 1x4 "Icon-Small@2x.png" | |
| convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png" | |
| convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png" | |
| convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png" |