Skip to content

Instantly share code, notes, and snippets.

View boriscy's full-sized avatar
🏠
Working from home

Boris Barroso boriscy

🏠
Working from home
  • Lead With Purpose
  • Samaipata, Bolivia
View GitHub Profile
class Welss::Texas
BUILD = [:build_api, :build_county_name, :build_well_name]
def build
BUILD.each {|m| send(m) }
end
end
@boriscy
boriscy / ssh_config
Created March 13, 2014 18:20
ssh configuration to make work on linuxmint 16 /etc/ssh/ssh_config
Host *
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
HostKeyAlgorithms ssh-rsa,ssh-dss
MACs hmac-md5,hmac-sha1,hmac-ripemd160
parseDateDB = function(d) {
arr = d.split('-')
y = arr[0]
m = arr[1] * 1 - 1
d = arr[2]
try {
return new Date(y, m, d)
} catch (e)
return new Date()
}
module Models::HstoreMap
def convert_hstore_to(to_type, *methods)
methods.each do |meth|
alias_method :"old_#{meth}", meth
define_method meth do
send(:"old_#{meth}").try(to_type)
end
end
end
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
' 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
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)
'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
'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