Hello Le Wagon 👋
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
#!/usr/bin/env ruby | |
require 'selenium-webdriver' | |
wd = Selenium::WebDriver.for :remote, url: 'http://10.3.1.7:4444/wd/hub', desired_capabilities: :chrome | |
wd.navigate.to 'https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/' | |
# Get the actual page dimensions using javascript | |
# | |
width = wd.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);") |
Hello Le Wagon 👋
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
# Kill spring if its running | |
run "if uname | grep -q 'Darwin'; then pgrep spring | xargs kill -9; fi" | |
#################################### GEMFILE ################################### | |
gsub_file './Gemfile', /(^ $|# .+$)/, '' | |
gsub_file './Gemfile', /^\n/, '' | |
gsub_file './Gemfile', /^ $/, '' | |
gsub_file './Gemfile', /^\n/, '' | |
gsub_file './Gemfile', /^ruby.+$/, "\nruby '#{RUBY_VERSION}'" | |
gsub_file './Gemfile', /^gem 'rails'.+$/, "\n# Base\ngem 'rails', '~> #{Rails.version}'" |
The most general and important advice I can give you is: build things. If you're practicing by yourself, find a problem you want to solve. Be it a page component you're interested in (a navbar that hides on a threshold) or an entire, but simple, app (a downscaled Evernote clone), it's important to have clear goals and to be able to see the results of your work.
I'll suggest only one thing here...:
Run rails new --help
to view all of the options you can pass to rails new
:
$ bin/rails new --help
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
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
require 'mail' | |
require 'csv' | |
password = 'AQUI TU CONTRASEÑA' | |
user = "AQUI TU CORREO (gmail)" | |
csv_options = { col_sep: ',', quote_char: '"', headers: :first_row } | |
filepath = 'correos.csv' | |
options = { | |
address: 'smtp.gmail.com', | |
port: 587, | |
user_name: user, |
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
//For unfollowing | |
var inputs = document.getElementsByClassName('icon icon-button-unfollow pointer action-button'); | |
for(var i=0; i<inputs.length;i++) { | |
inputs[i].click(); } | |
//For following | |
var inputs = document.getElementsByClassName('icon icon-button-follow pointer action-button'); | |
for(var i=0; i<inputs.length;i++) { | |
inputs[i].click(); } |
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
function largestPhoneCalculator(pn1, pn2, pn3) { | |
var aPhoneNumber = []; | |
var stringNumber = pn1.toString(); | |
for (var i = 0, lngt = stringNumber.length; i < lngt; i++) { | |
aPhoneNumber.push(+stringNumber.charAt(i)); | |
} | |
for (var i = 0, sum = 0; i < aPhoneNumber.length; sum += aPhoneNumber[i++]); | |
//console.log(sum); |
NewerOlder