This file contains 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
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 |
This file contains 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
$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...' |
This file contains 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
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; | |
This file contains 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
= 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 } |
This file contains 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
['Admin', 'Developer', 'Customer'].forEach((role) => { | |
Executor.prototype[`is${role}`] = (item)=> { | |
return item.type === role | |
} | |
}) | |
and then data.isAdmin |
This file contains 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
scope :availables, lambda { |scope_by| | |
public_send(scope_by) if %w(count).include?(scope_by) | |
} |
This file contains 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
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 ) { |
This file contains 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
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; | |
} |
This file contains 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
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' |
This file contains 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
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;'" |
OlderNewer