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.
require 'pi_piper' | |
require 'ostruct' | |
laser = PiPiper::Pin.new(pin: 17, direction: :out) | |
alarm = PiPiper::Pin.new(pin: 18, direction: :out) | |
vibration = PiPiper::Pin.new(pin: 27, direction: :in) | |
i2c = PiPiper::I2C.new | |
def turn_on(pin) | |
pin.off |
# Italian translation for Devise 4.2 | |
# Date: 2016-08-01 | |
# Author: epistrephein, iwan | |
# Note: Thanks to xpepper (https://gist.github.com/xpepper/8052632) | |
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
it: | |
devise: | |
confirmations: | |
confirmed: "Il tuo account è stato correttamente confermato." |
it: | |
devise: | |
failure: | |
invited: "Hai un invito in sospeso, accettalo per completare la creazione del tuo account." | |
invitations: | |
send_instructions: "Un'email di invito è stata inoltrata a %{email}." | |
invitation_token_invalid: "Il token di invito fornito non è valido!" | |
updated: "La tua password è stata impostata correttamente. Ora sei connesso." | |
updated_not_active: "La tua password è stata impostata correttamente." | |
no_invitations_remaining: "Non sono più disponibili inviti." |
# adapted from | |
# http://adamniedzielski.github.io/blog/2014/11/25/my-take-on-services-in-rails/ | |
class CreateUserAccount | |
attr_reader :user | |
def initialize(send_email_service: SendEmail.new, generate_token_service: GenerateToken.new) | |
@send_email_service = send_email_service | |
@generate_token_service = generate_token_service | |
end |
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.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
class Klass | |
def initialize(number) | |
self.number = number | |
end | |
attr_reader :number | |
private | |
attr_writer :number |
In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.
It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.
you might want to take a look at a demo app
# LDAP Configuration | |
development: | |
host: localhost | |
port: 636 | |
base: ou=bar,dc=foo,dc=com | |
admin_user: cn=admin,dc=foo,dc=com | |
admin_password: password | |
ssl: false | |
production: |