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
# Create user | |
# useradd | |
# login with user | |
sudo apt-get install curl git-core | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] >> .bashrc | |
source $HOME/.rvm/scripts/rvm | |
rvm install ruby-1.8.7 | |
# install all dependencies | |
sudo apt-get install apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev |
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
#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883 | |
linecache19-0.5.13.gem | |
ruby_core_source-0.1.5.gem | |
ruby-debug19-0.11.6.gem | |
ruby-debug-base19-0.11.26.gem | |
#Then in your console | |
export RVM_SRC=/your/path/to/ruby-1.9.3 |
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
# encoding: utf-8 | |
# app/controllers/application_controller.rb | |
# author: Boris Barroso | |
# email: boriscyber@gmail.com | |
class ApplicationController < ActionController::Base | |
layout lambda{ |c| | |
if (c.request.xhr? or params[:xhr]) | |
false | |
elsif params[:print].present? | |
"print" |
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
# Create the file `config/initializers/queue_classic.rb` with the this contents | |
ENV["DATABASE_URL"] = "postgres://username:password@host/database" | |
require 'queue_classic' | |
module QC | |
TABLE_NAME='common.queue_classic_jobs' | |
module Setup | |
extend self |
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
'Runs a country iteration and does many calculations | |
Sub CountryIterations() | |
Dim iteration, period As Integer | |
iteration = Range("countryIterations") | |
If Not (IsNumeric(iteration)) Or iteration < 10 Then | |
MsgBox ("You must set the iterations above 10, check address " + Range("countryIterations").AddressLocal) | |
Exit Sub | |
End If |
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
' Runs the stochastic analisys for selected countries | |
' Result Row 489 | |
Sub StochasticAnalisysCountries() | |
Application.Calculation = xlSemiautomatic | |
'Application.ScreenUpdating = False | |
Range("OilPriceSelect") = "Stochastic Price Live" | |
Range("GasPriceSelect") = "Stochastic Price Live" | |
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
'Runs a country iteration and does many calculations | |
Sub CountryIterations() | |
Dim iteration, period As Integer | |
iteration = Range("countryIterations") | |
If Not (IsNumeric(iteration)) Or iteration < 10 Then | |
MsgBox ("You must set the iterations above 10, check address " + Range("countryIterations").AddressLocal) | |
Exit Sub | |
End If |
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
'Runs a country iteration and does many calculations | |
Sub CountryIterations() | |
Dim iteration, period As Integer | |
iteration = Range("countryIterations") | |
If Not (IsNumeric(iteration)) Or iteration < 10 Then | |
MsgBox ("You must set the iterations above 10, check address " + Range("countryIterations").AddressLocal) | |
Exit Sub | |
End If |
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
Controllers | |
============== | |
class HomeController < ApplicationController | |
def votes | |
@lista_pueblo = Table.sum(:lista_pueblo) | |
@lista_sur = Table.sum(:lista_sur) | |
@lista_frente_grande = Table.sum(:lista_frente_grande) | |
@lista_union_pro = Table.sum(:lista_union_pro) |
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
' This module contains method for copying and referencing data | |
' Updates the selected items from H:12 to H:25 | |
Sub UpdateSelected() | |
Application.Calculation = xlManual | |
' First Check update productioin escenarios | |
'If Range("Upd_Scenarios") = "Yes" Then | |
'Call UpdateProductionScenaries | |
'End If | |