Skip to content

Instantly share code, notes, and snippets.

View viktor-shmigol's full-sized avatar

Viktor Shmigol viktor-shmigol

View GitHub Profile
1) Need to open port 28080 for security group
2) add gem 'puma'
3) create file deploy/after_restart.rb:
execute 'actionCable' do
cwd current_release
command 'bundle exec puma -p 28080 cable/config.ru -e production -d'
end
$scope.download = (url) ->
filename = url.split('/').pop()
url = encodeURI(url)
if ionic.Platform.isIOS()
directory = cordova.file.documentsDirectory
else
directory = "#{cordova.file.externalRootDirectory}Download/"
document.addEventListener 'deviceready', (->
$ionicLoading.show template: 'Loading...'
server {
listen 9000 default_server;
listen [::]:9000 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
= select :user, :type, options_for_select(User::TYPES, selected: user.type), {}, data: { remote: true, url: admin_user_path(user.id, type: params[:type]), method: :put }
['Admin', 'Developer', 'Customer'].forEach((role) => {
Executor.prototype[`is${role}`] = (item)=> {
return item.type === role
}
})
and then data.isAdmin
scope :availables, lambda { |scope_by|
public_send(scope_by) if %w(count).include?(scope_by)
}
import { Http, RequestOptions, ConnectionBackend, RequestOptionsArgs, Response } from '@angular/http'
import { Injectable } from '@angular/core'
import { PromiseTrackerService } from './promise_traker'
import { Observable } from 'rxjs'
import 'rxjs/add/operator/map';
export class HttpLoading extends Http {
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions, private promiseTrackerService: PromiseTrackerService ) {
location /cable {
proxy_pass http://puma;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
Add the overcommit gem to your Gemfile in the development group,
Run overcommit --install, and
Configure overcommit to run Rubocop before a commit is complete by modifying the .overcommit.yml file. PreCommit: # Ignore all Overcommit default options ALL: enabled: false on_warn: fail
# Enable explicitly each desired pre commit check
RuboCop:
enabled: true
description: 'Analyzing with Rubocop'
required_executable: 'rubocop'
docker-compose-prod.yml:
```
version: '2'
services:
web:
build:
context: .
dockerfile: ./Dockerfile_prod
command: /bin/bash -c "envsubst '$$NGINX_HOST $$NGINX_PORT' < /etc/nginx/conf.d/angular-seed.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"