Source: https://wiki.archlinux.org/index.php/PostgreSQL
-
Install postgresql package
sudo pacman -S postgresql -
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgresSource: https://wiki.archlinux.org/index.php/PostgreSQL
Install postgresql package
sudo pacman -S postgresql
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres| Алгоритмы: | |
| 1) Стивен Скиена "Алгоритмы. Руководство по разработке" | |
| 2) Томас Кормен "Алгоритмы. Построение и анализ" | |
| 3) Дональд Кнут "Искусство программирования" (никто в реальности не читал этот многотомный труд целиком, но в любой подборке по алгоритмам он обязан быть) | |
| Общее: | |
| 1) Род Хаггарти "Дискретная математика для программистов" | |
| 2) Керниган, Ритчи "Язык программирования С" - для общего понимания принципов программирования | |
| 3) Дж. Андресон "Дискретная математика и комбинаторика" | |
| 4) Романовский И.В. "Дискретный анализ" |
| # Welcome to my "arel gist"! | |
| ## It started hacky, then as an example, but we want it cleaner. | |
| # ActiveRecord | |
| ## This is an ORM: you call Ruby methods and get Ruby objects, it makes SQL and object instantiations for you. | |
| ## It's Rails' default, but there are alternatives: https://github.com/Sdogruyol/awesome-ruby#orm | |
| Student.all | |
| Topic.first | |
| Workshop.sum(:hours) |
In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.
But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.
So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.
Before we generate our channels let's install a few things
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| module ArelHelpers | |
| extend self | |
| def self.included(base) | |
| base.extend self | |
| end | |
| def asterisk(arel_table_or_model) | |
| arel_table, columns = case arel_table_or_model | |
| when Arel::Table |
These rules are adopted from the AngularJS commit conventions.
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| # This probably isn't a good thing to want to do, but it came up for me, | |
| # so in the spirit of helping others with weird problems (and because this | |
| # seems to be documented almost nowhere): | |
| after_save do | |
| if some_failing_condition | |
| errors.add(:something, "some failure happened.") | |
| raise ActiveRecord::RecordInvalid.new(self) | |
| end |
| # A commented nginx configuration file for Ruby on Rails | |
| # | |
| # Author: Tommaso Pavese | |
| # tommaso@pavese.me | |
| # http://tommaso.pavese.me | |
| # | |
| # License: http://www.wtfpl.net/ | |
| # | |
| # | |
| # Tested with: |