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
class ReportsController < ApplicationController | |
rescue_from ArgumentError, :with => :invalid_report | |
before_filter :require_user | |
def show | |
respond_to do |wants| | |
wants.json { render :json => UserReportFactory.get_report( current_user, params[:id] ), :status => :ok } | |
wants.csv { | |
filename = "woople_#{params[:id]}.csv" |
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
ActiveRecord::Schema.define(:version => 20100527145216) do | |
create_table "access_rights", :force => true do |t| | |
t.integer "group_id", :null => false | |
t.integer "restrictable_id" | |
t.string "restrictable_type" | |
t.datetime "created_at" | |
t.datetime "updated_at" | |
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
+--------------------+--------+---------+------------+------+----------------+-------------+-------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+-------------------+ | |
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | | |
+--------------------+--------+---------+------------+------+----------------+-------------+-------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+-------------------+ | |
| access_rights | InnoDB | 10 | Compact | 1 | 16384 | 16384 | 0 | 16384 | 0 | 89 | |
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
PASSWORD = lambda { |login| | |
Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--")[0,8] | |
} | |
PASSWORD.call("username") |
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
# builds an authenticated S3 query string without having | |
# to connect to the server first | |
class S3QueryString < String | |
def initialize(path, bucket, options = {}) | |
super() | |
@access_key_id = options[:access_key_id] | |
@secret_access_key = options[:secret_access_key] | |
@bucket = bucket |
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
package com.application.shared.ui.controls | |
{ | |
import flash.display.DisplayObject; | |
import flash.display.StageDisplayState; | |
import flash.events.Event; | |
import flash.events.FullScreenEvent; | |
import flash.events.KeyboardEvent; | |
import flash.events.MouseEvent; | |
import flash.events.TimerEvent; | |
import flash.geom.Rectangle; |
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
Edit the file /var/www/vhosts/:virtual_host/conf/httpd.include | |
Replace #{server_ip}, :domain_name, :virtual_host, :application, #{application_port} with your own details. | |
--- | |
<VirtualHost #{server_ip}:80> | |
ServerName :domain_name:80 | |
ServerAlias *.:domain_name | |
DocumentRoot /var/www/vhosts/:virtual_host/:application/public | |
<Directory /var/www/vhosts/:virtual_host/:application/public> |
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
touch /etc/init.d/supervisord.init | |
--- edit the file to look like the following: | |
# chkconfig: 345 20 80 | |
# description: Manages processes | |
/usr/bin/supervisord | |
--- |
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
echo_supervisord_conf > /etc/supervisord.conf #sets up the sample supervisor configuration. | |
-- now edit the file and add your application details. Here is a sample. Replace :virtual_host with your virtual host name. | |
[program:myapp] | |
command=/var/www/vhosts/:virtual_host/application/start.sh | |
autostart=true | |
autorestart=true | |
startretries=3 | |
stdout_logfile=/var/www/vhosts/:virtual_host/application/log/server.log |
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
touch /var/www/vhosts/:virtual_host/application/start.sh | |
--- edit the file to include the following. Replace :virtual_host and :application.js with your own files. | |
#! /bin/sh | |
cd /var/www/vhosts/:virtual_host/application | |
/usr/local/bin/node :application.js |