The goal: Upload several files (virtually big files) to a Rails application without compromising the user experience.
jQuery File Upload + Nginx + Rails (Carrierwave) + Sidekiq
- jQuery File Upload (http://blueimp.github.io/jQuery-File-Upload/)
| /* | |
| * Select2 v3.4.6 styles customization for Flat UI | |
| */ | |
| /*----------------------------------------------- Main select element ------------------------------------------------*/ | |
| .select2-container .select2-choice { | |
| height: 41px; /* Jobsy form controls have 37px total height */ | |
| border: 2px solid #bdc3c7; | |
| border-radius: 6px; | |
| outline: none; | |
| font: 15px/38px "Lato", Liberation Sans, Arial, sans-serif; |
| package httptimeout | |
| import ( | |
| "net/http" | |
| "time" | |
| "fmt" | |
| ) | |
| type TimeoutTransport struct { | |
| http.Transport |
The goal: Upload several files (virtually big files) to a Rails application without compromising the user experience.
jQuery File Upload + Nginx + Rails (Carrierwave) + Sidekiq
| from flask import Flask | |
| def configure_uwsgi(app): | |
| # Setup debugging, logging for uwsgi. | |
| try: | |
| import uwsgi | |
| except ImportError: | |
| return | |
| from time import strftime |
| # lib/capistrano/tasks/config_files.cap | |
| # | |
| # Capistrano task to upload configuration files outside SCM | |
| # Jesus Burgos Macia | |
| # | |
| # This allows us to have server's config files isolated from development ones. | |
| # That's useful for several reasons, but the most important is that you can | |
| # ignore files from repository. | |
| # | |
| # The task will upload all files found in |
| #!/bin/bash | |
| # options: | |
| # remove stopped containers and untagged images | |
| # $ dkcleanup | |
| # remove all stopped|running containers and untagged images | |
| # $ dkcleanup --reset | |
| # remove containers|images|tags matching {repository|image|repository\image|tag|image:tag} | |
| # pattern and untagged images | |
| # $ dkcleanup --purge {image} |
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |
| ########### | |
| # general # | |
| ########### | |
| # Replace C-b prefix with Alt+Space (so it won't clash with vim) | |
| unbind C-b | |
| set-option -g prefix M-Space | |
| set-window-option -g mode-keys vi | |
| # set-option -g default-shell /usr/local/bin/fish |
This article expects that you already have done the 101 AngularJS journey. If you're new to AngularJS then you'd best checkout the AngularJS Tutorial or Code Academy - AngularJS Patterns Tutorial(NB: this is for Angular 1.0.6) before continuing with this article. What we're really focusing on here are the decisions I've made and nuances discovered during the transition of a Rails app with the least resistance using the following stack:
| --- | |
| title: "twee demo" | |
| author: "Jenny Bryan" | |
| date: "17 August, 2014" | |
| output: | |
| html_document: | |
| toc: TRUE | |
| keep_md: TRUE | |
| --- |