- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ru: | |
| devise: | |
| confirmations: | |
| confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему." | |
| send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи." | |
| send_paranoid_instructions: "Если ваш адрес email есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи." | |
| failure: | |
| already_authenticated: "Вы уже вошли в систему." | |
| inactive: "Ваша учётная запись ещё не активирована." | |
| invalid: "Неверный адрес email или пароль." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start the old vagrant | |
| $ vagrant init centos-6.3 | |
| $ vagrant up | |
| # You should see a message like: | |
| # [default] The guest additions on this VM do not match the install version of | |
| # VirtualBox! This may cause things such as forwarded ports, shared | |
| # folders, and more to not work properly. If any of those things fail on | |
| # this machine, please update the guest additions and repackage the | |
| # box. |
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
- install packages for vim, git
- create user accounts, as specified in included JSON config files
- install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository
Afterwards, we'll see how easy it is to package our newly provisioned VM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Model using the ghostscript processor | |
| class Content < ActiveRecord::Base | |
| has_attached_file :resource, | |
| :styles => { :preview => ["725x1200>", :jpg], :thumb => ["100x140>", :jpg] }, | |
| :processors => [:ghostscript, :thumbnail], | |
| :convert_options => { :all => '-colorspace RGB -flatten -density 300 -quality 100' }, | |
| :path => ":page_path/:class/:id/:resource_token/:style/:filename" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <section class="left"> | |
| <article id="customers"> | |
| <h2>New Customers</h2> | |
| <table class="data"> | |
| <thead> | |
| <tr> | |
| <th>ID</th> | |
| <th>First Name</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| apt-get -y update | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
| cd /tmp | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
| tar -xvzf ruby-1.9.3-p125.tar.gz | |
| cd ruby-1.9.3-p125/ | |
| ./configure --prefix=/usr/local | |
| make | |
| make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'action_dispatch/middleware/static' | |
| module Middleware | |
| class FileHandler < ActionDispatch::FileHandler | |
| def initialize(root, assets_path, cache_control) | |
| @assets_path = assets_path.chomp('/') + '/' | |
| super(root, cache_control) | |
| end | |
| def match?(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require File.join(File.dirname(__FILE__), 'deploy/nginx') | |
| require File.join(File.dirname(__FILE__), 'deploy/log') | |
| default_run_options[:pty] = true | |
| set :ssh_options, { :forward_agent => true } | |
| set :application, "appname" | |
| set :repository, "git@giturl" | |
| set :scm, :git |