Skip to content

Instantly share code, notes, and snippets.

View RoRElessar's full-sized avatar

Alexey Zakruzhetskyi RoRElessar

View GitHub Profile
@RoRElessar
RoRElessar / gist:2e7ff4429629b6d61efa0c2e0adbd0f9
Last active April 24, 2020 14:21
Symlink for Chrome (WSL)
I'm using WSL for Rails system tests on 5.1 with rspec/capybara/selenium and ran into a similar issue.
Instead of /usr/bin/chromium-browser, my process initiating chrome was at /usr/local/bin/google-chrome. I was able to resolve the error by creating a symlink to chrome.exe on my Windows file system (in the Program Files (x86) folder). From a bash shell:
cd /usr/local/bin
ln -s "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" /usr/local/bin (create a symlink to Chrome on Windows file system. Your Chrome path may be different)
mv chrome.exe chrome (rename 'chrome.exe' as 'chrome' for selenium driver used in system tests)
# Capybara config in spec/rails_helper.rb:
@RoRElessar
RoRElessar / readme.md
Last active February 28, 2020 07:41 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@RoRElessar
RoRElessar / cygwin-rvm.md
Created February 20, 2019 15:36 — forked from kirkelifson/cygwin-rvm.md
RVM Install on Windows

Do you have spaces in your Windows username?

  1. Create a new account on Windows without a space.

#Installation

  1. Download cygwin from http://cygwin.com
  2. Run setup-(x86|x86_64).exe
  3. Click next until selecting repo to download packages
  4. Choose http://cs.vt.edu (gotta go fast), click next
@RoRElessar
RoRElessar / add_intellij_launcer
Created February 18, 2018 16:09 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@RoRElessar
RoRElessar / 1 setup vps
Created December 5, 2017 14:15 — forked from PavloBezpalov/1 setup vps
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
//app/views/jst/wiki/WikiPage.handlebars
{{#if CAN.VIEW_TOOLBAR}}
<div class="header-bar-outer-container">
<div class="header-bar-container sticky-toolbar" data-sticky>
<div class="header-bar flex-container">
<div class="header-bar-left header-left-flex">
{{#if course_home}}
<h2 class="course-title ellipsis" title="{{course_title}}">{{course_title}}</h2>
{{else}}
Шаг 1. При установке Node.js воспользуемся NVM(Node Version Manager), с помощью которого упрощается установка сразу нескольких версий Node.JS и переключение между ними.
Приступаем к установке nvm. Программа часто обновляется, поэтому каждый раз берем скрипт установки со страницы проекта на github (https://github.com/creationix/nvm)
Рассмотрим на примере v0.32.1.
В командной строке набираем:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
После запуска скрипта нам нужно будет выйти из консоли и войти заново, чтобы функциональность nvm стала доступна. Чтобы не выходить из текущей сессии, можно воспользоваться следующей командой:
@RoRElessar
RoRElessar / secret_key_base
Created December 19, 2016 15:50 — forked from pablosalgadom/secret_key_base
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message:
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)"
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@RoRElessar
RoRElessar / 1 Gist conventions
Last active March 30, 2017 20:24 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 4.2.6 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL.
<<USER>> <<APP>> change this variables
@RoRElessar
RoRElessar / Omniauth Twitter Hash
Created October 4, 2016 08:49 — forked from holin/Omniauth Twitter Hash
Twitter Authentication hash
--
provider: twitter
uid: '15280529'
info:
  nickname: penguinbusiness
  name: Charlie Moseley
  location: Bellevue, WA
  image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif
  description: Developer, Otaku, Geek.
  urls: