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
// 1. Import everything | |
import { Wallet, BigNumber, ethers, providers } from 'ethers' | |
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle') | |
/* | |
Mainnet | |
const provider = new providers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh') | |
const wsProvider = new providers.WebSocketProvider('wss://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh') | |
*/ |
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
# nil? can be used on any Ruby object. It returns true only if the object is nil. | |
nil.nil? # => true | |
[].nil? # => false | |
{}.nil? # => false | |
"".nil? # => false | |
" ".nil? # => false | |
true.nil? # => false | |
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero. | |
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass |
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
require 'watir' | |
require 'webdrivers' | |
#Start a new session | |
browser = Watir::Browser.new | |
browser.goto ("wikipedia.org") | |
#Count all the links on the page. | |
puts browser.links.count |
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
=begin | |
Template Name: template.rb | |
Author: Me | |
Instructions: $ rails new my-app -d<postgresql, mysql, sqlite3> -m example_template.rb | |
=end | |
def source_path | |
[File.expand_path(File.dirname(__FILE__))] | |
end |