brew install chromedriver
Add to env.rb:
Capybara.javascript_driver = :chrome
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
# Launch Pry with access to the entire Rails stack. | |
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
# If you don't, you can load it through the lines below :) | |
rails = File.join Dir.getwd, 'config', 'environment.rb' | |
if File.exist?(rails) && ENV['SKIP_RAILS'].nil? | |
require rails | |
if Rails.version[0..0] == "2" | |
require 'console_app' |
brew install chromedriver
Add to env.rb:
Capybara.javascript_driver = :chrome
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
t1 = Time.now | |
file = File.new(ARGV[0] || "input.txt", "r") | |
numbers = file.readlines.map!(&:to_i) | |
p Time.now - t1 | |
[231552, 234756, 596873, 648219, 726312, 981237, 988331,1277361,1283379].each do |x| | |
tmp = Array.new(numbers.size) | |
time = Time.now | |
res = numbers.detect { |el| tmp[el] || ((x - el) > 0 && (tmp[x - el] = true) && false) } ? 'yes' : 'no ' | |
p "#{'%7.0f' % x} - #{res} - #{Time.now - time}" |
{ | |
"args": | |
{ | |
"cycle": "previous" | |
}, | |
"auto_complete": false, | |
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme", | |
"command": "alternative_autocomplete", | |
"context": | |
[ |
sudo chown -R $USER /usr/local | |
sudo chown -RL mysql:mysql /usr/local/mysql/data |
Write a program, which outputs numbers from 0 to 1000 without: | |
loops (do, while, for, etc.) | |
jumps (goto) | |
exceptions | |
conditions | |
boolean operators (and, or, etc.) | |
comparison operators (<, >, etc.) | |
ranges | |
preprocessor shit |
sudo ifconfig en0 down; sleep 1; sudo ifconfig en0 up | |
#Quiz:
What’s the result of:
console.log(f());
function f() {
return 1;
}
Answers:
#Quiz:
What’s the result of:
function A() {}
A.prototype.name = 'A';
var a = new A();
var b = new A();