- Initially install your pry-rails to group development on your apps Gemfile
group :development do
# ..
gem 'pry-rails'
# ..
end| require 'irb/completion' | |
| require 'rubygems' | |
| ActiveRecord::Base.logger.level = 1 if defined?(ActiveRecord) | |
| IRB.conf[:SAVE_HISTORY] = 1000 | |
| # Overriding Object class | |
| class Object | |
| # Easily print methods local to an object's class | |
| def lm |
group :development do
# ..
gem 'pry-rails'
# ..
end| var npm = require("npm"); | |
| var fs = require("fs-extra"); | |
| var chokidar = require("chokidar"); | |
| var packagePaths = [ | |
| "../mobile-app/node_modules/shared-package/lib", | |
| "../web-app/node_modules/shared-package/lib", | |
| ]; | |
| var noop = () => {}; |
In Rails 4 it is useful to have a 'page loading' indicator when a user clicks a link. This is a simple way to accomplish that without external libraries. Tested on Rails 4 using TurboLinks.
Great Link for Spinning Loader gifs: http://loading.io/
On CSS Page:
.modal {
display: none;
position: fixed;| # lib/rails_routes_reloader.rb | |
| class RailsRoutesReloader | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| reload_routes_if_changed | |
| return *@app.call(env) |
| // config/environment.js | |
| module.exports = function(environment) { | |
| var ENV = { | |
| modulePrefix: 'ember-cli-pubnub', | |
| environment: environment, | |
| baseURL: '/', | |
| locationType: 'auto', | |
| EmberENV: { | |
| FEATURES: { |
| # This file was generated by the `rails generate rspec:install` command. Conventionally, all | |
| # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
| # The generated `.rspec` file contains `--require spec_helper` which will cause this | |
| # file to always be loaded, without a need to explicitly require it in any files. | |
| # | |
| # Given that it is always loaded, you are encouraged to keep this file as | |
| # light-weight as possible. Requiring heavyweight dependencies from this file | |
| # will add to the boot time of your test suite on EVERY test run, even for an | |
| # individual file that may not need all of that loaded. Instead, make a | |
| # separate helper file that requires this one and then use it only in the specs |
Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.
My top contenders, mostly based on popularity / community etc:
Mostly about MVC (or derivatives, MVP / MVVM).
| import Ember from 'ember'; | |
| import ModalSupport from '../mixins/modal-support'; | |
| export default Ember.Controller.extend(ModalSupport, { | |
| actions: { | |
| tryModal: function() { | |
| var _this = this; | |
| _this.modalFor({template: 'some-template', | |
| title: 'Some Title'}) |
| import Ember from 'ember'; | |
| var get = Ember.get, | |
| arrayComputed = Ember.arrayComputed; | |
| export default function (dependentKey, property) { | |
| var options = { | |