$ psql -d postgres
postgres=# create role "app_name" login createdb;
postgres=# \q
The first line is in your terminal, the next two are inside psql. Then do your rake db:create.
The User user is possibly a default but user is already taken for other purposes in PostgreSQL so
you'd have to quote it to preserve the case if you wanted to use User as a username:
postgres=# create role "User" login createdb;
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
| module ApplicationHelper | |
| def responsive_image_tag(image, options = {}) | |
| content_tag(:picture) do | |
| concat content_tag(:source, nil, media: '(max-width: 768px)', srcset: image.url(:thumbnail_mobile)) | |
| concat content_tag(:source, nil, media: '(max-width: 960px)', srcset: image.url(:thumbnail_tablet)) | |
| concat image_tag(image.url(:thumbnail_desktop), options) | |
| end | |
| end | |
| 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
| # frozen_string_literal: true | |
| module ImagesHelper | |
| # Acts as a thin wrapper for image_tag and generates an srcset attribute for regular image tags | |
| # for usage with responsive images polyfills like picturefill.js, supports asset pipeline path helpers. | |
| # | |
| # image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image' | |
| # => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image"> | |
| # | |
| # image_set_tag 'logo-amzlenders.png', {'[email protected]' => '2x'} | |
| # => <img srcset="/assets/[email protected] 2x" src="/assets/logo-amzlenders.png" alt="Logo amzlenders"> |
brew update
cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/[email protected]
brew reinstall [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
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
| # Inline svg from @tomeara https://gist.github.com/tomeara/6515860 | |
| def inline_svg(source) | |
| file = File.open("app/assets/images/#{source}", "rb") | |
| raw file.read | |
| end | |
| # SVG internal link | |
| #= svg_tag 'sprite/icons.svg', 'icon-facebook-invers' | |
| module SvgHelper |
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
| :root { | |
| font-size: calc(0.6em + 1vw) | |
| } | |
| @mixin for-size($range) { | |
| $phone-upper-boundary: 600px; | |
| $tablet-portrait-upper-boundary: 900px; | |
| $tablet-landscape-upper-boundary: 1200px; | |
| $desktop-upper-boundary: 1800px; |
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
| erb | |
| <% unless current_page?('/') || current_page?('/projects') %> | |
| # '/' the same as root_path | |
| show some stuff | |
| <% end %> | |
| slim, haml | |
| - unless current_page?('/') || current_page?('/projects') | |
| | \# '/' the same as root_path | |
| | show some stuff |
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
| .slider ul { | |
| max-height: 0; | |
| overflow: hidden; | |
| } | |
| .slider:hover ul { | |
| max-height: 1000px; | |
| transition: .3s ease; /* анимация для max-height */ | |
| } |
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
| var pageFacade = { | |
| updateMenu: function() { | |
| loadData(); | |
| resizeColumn(); | |
| updateCounter(); | |
| setLog(); | |
| }, | |
| doSmthElse: function() { | |
| // a lot of methods | |
| } |
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
| //part 1 | |
| function Player(name) { | |
| this.points = 0; | |
| this.name = name; | |
| } | |
| Player.prototype.play = function () { | |
| this.points += 1; | |
| mediator.played(); | |
| }; | |
| var scoreboard = { |