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
searchBox.addListener('places_changed', function() { | |
var places = searchBox.getPlaces(); | |
if (places.length == 0) { | |
return; | |
} | |
var geometries = places.map(function(place) { | |
return place.geometry | |
}); |
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
# Run it like this in shell | |
# | |
# PATH_TO_REPORT=xxx/bx-999999.csv bx_port_calculation | |
# | |
# Notes: | |
# - PATH_TO_REPORT is relative to your home directory. | |
# - Change currencies to match your portfolio | |
# - WIP so it's probably need more work. | |
require '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
set nocompatible " be iMproved, required | |
filetype off " required | |
syntax on | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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
autoload -U promptinit; promptinit | |
prompt pure | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
eval "$(rbenv init -)" | |
eval "$(pyenv init -)" | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/vtno/.oh-my-zsh | |
export PATH="$HOME/.Pokemon-Terminal:${PATH}" |
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
dependencies: | |
pre: | |
# install chrome | |
- wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/ | |
- sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb | |
- sudo apt-get -f install -y | |
- sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb | |
- sudo rm /usr/local/bin/chromedriver | |
# install chromedriver | |
- wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/ |
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
# frozen_string_literal: true | |
require 'capybara/rspec' | |
IS_DEBUG_MODE = -> { ENV['DEBUG'].present? ? :chrome : :headless_chrome } | |
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, browser: :chrome) | |
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
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed and saved. | |
* | |
* Add your own CSS or Less to fully customize Atom. | |
* If you are unfamiliar with Less, you can read more about it here: | |
* http://lesscss.org | |
*/ |
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
const preciseOperation = f => (a, b, decimalDigits) => { | |
decimalDigits = decimalDigits || 12 | |
+(f(a, b)).toFixed(decimalDigits) | |
} | |
const add = (a, b) => a + b | |
const minus = (a, b) => a - b | |
const multiply = (a, b) => a * b | |
const divide = (a, b) => a / b | |
export const preciseAdd = (a, b, decimalDigits) => preciseOperation(add)(a,b, decimalDigits) | |
export const preciseMinus = (a, b, decimalDigits) => preciseOperation(minus)(a,b, decimalDigits) |
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
Item = Struct.new(:amount, :price, :name) do | |
def total_price | |
amount * price | |
end | |
end | |
Cart = Struct.new(:items) do | |
# total amount is finding sum of item amount | |
def total_amount | |
# a.k.a finding sum by item.amount function |
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
# frozen_string_literal: true | |
Report = Struct.new(:sale_revenue, :gross_profit, :cogs) | |
def main | |
puts '## First report ##' | |
puts 'Input revenue: ' | |
revenue1 = gets.chomp.to_f | |
puts 'Input gross profit: ' | |
gp1 = gets.chomp.to_f |