NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| ####################################################################################################################### | |
| # This Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly | |
| # helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html | |
| ####################################################################################################################### | |
| require 'rubygems' | |
| require 'net/ldap' | |
| ####################################################################################################################### | |
| # HELPER/UTILITY METHOD |
| # | |
| # One-liners (or one'ish-liners) | |
| # | |
| pry(main)> Psych::VERSION | |
| => "3.1.0" | |
| pry(main)> show-source Psych | |
| => # lots of code | |
| pry(main)> show-method meth_name | |
| # From: /home/some_code.rb:233: |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>| // clear canvas | |
| canvas.clear(); | |
| // add red rectangl | |
| canvas.add(new fabric.Rect({ | |
| width: 50, height: 50, left: 50, top: 50, fill: 'rgb(255,0,0)' | |
| })); | |
| canvas.add(new fabric.Rect({ | |
| width: 50, height: 50, left: 110, top: 50, fill: 'rgb(255,0,0)' |
| Rails scaffolding types | |
| These types are valid since Rails version 2: | |
| string | |
| text (long text, up to 64k, often used for text areas) | |
| datetime | |
| date | |
| integer | |
| binary | |
| boolean |
| <?php | |
| trait MetaClass | |
| { | |
| protected $__classMethods = array(); | |
| static protected $__staticMethods = array(); | |
| public function __call($name, $args) | |
| { |
| Rails.configuration.cache_classes = true | |
| Rails.configuration.threadsafe! | |
| Rails.configuration.allow_concurrency = true | |
| require "#{Rails.root}/test/factories" | |
| Dir.glob(File.join(Rails.root, 'app', '{lib,app}', '*.rb')).each{|f| require f} | |
| Rails.application.eager_load! | |
| puts "Creating users..." | |
| users = [] |
The list would not be updated for now. Don't write comments.
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:
githubUsers| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |