ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
module Excel | |
module Formulas | |
def pmt(rate, nper, pv, fv=0, type=0) | |
((-pv * pvif(rate, nper) - fv ) / ((1.0 + rate * type) * fvifa(rate, nper))) | |
end | |
def ipmt(rate, per, nper, pv, fv=0, type=0) | |
p = pmt(rate, nper, pv, fv, 0); | |
ip = -(pv * pow1p(rate, per - 1) * rate + p * pow1pm1(rate, per - 1)) | |
(type == 0) ? ip : ip / (1 + rate) |
####Rets Rabbit http://www.retsrabbit.com
Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.
This is a rough guide to setting up browser testing through Selenium on Windows Subsystem for Linux (WSL), aka Bash on Ubuntu on Windows. It assumes the following environment:
- Windows 10, running WSL
- A Ruby dev environment, running inside WSL
- Code that we want to test using a web driver, in this case Selenium, with a Capybara and RSpec test framework
The coding project folders are stored in the main Windows filing hierarchy and accessed via dev/mnt, but that makes no real difference to development and testing other than making it possible to edit the code using a GUI based editor within Windows.
The problem with browser testing in WSL is that it relies on opening and controlling a web browser, and browsers don’t work on WSL at present as it deliberately doesn’t include X Windows or some other GUI manager - it’s meant to be command line after all. So while you can apt-get firefox
, trying to actually run it isn’t going to work.
This works with Ubuntu 18.04LTS. I make no promises about other distributions, but direct anyone else to an older Gist which apparently works for 16.04LTS.
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
- Uninstall and reinstall the ssh server using the following commands:
sudo apt remove openssh-server
sudo apt install openssh-server
- With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
print "enter loan amount: " | |
loan = gets.chomp.to_i | |
print "Enter length of time in months: " | |
time = gets.chomp.to_i | |
print "Enter interest rate: " | |
rate = gets.chomp.to_f/100 | |
i = (1+rate/12)**(12/12)-1 | |
annuity = (1-(1/(1+i))**time)/i |
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
pragma solidity ^0.4.11; | |
contract Counter { | |
/* define variable count of the type uint */ | |
uint count = 0; | |
/* this runs when the contract is executed */ | |
function increment() public { | |
count = count + 1; |
0xd8e863a7d76D08Dd8540f691F544D31296e708A7 |