Elixir syntax highlighting example
list = [1, 2, 3]
[a, b, c] = list
def foo do
IO.puts "foo"
end
require "benchmark/ips" | |
Benchmark.ips do |x| | |
x.report("fast code description") { 38.to_roman_fast} | |
x.report("slow code description") { 38.to_roman_slow } | |
x.compare! | |
end |
Elixir syntax highlighting example
list = [1, 2, 3]
[a, b, c] = list
def foo do
IO.puts "foo"
end
A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.
I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.
I'd love comments and suggestions about any of these.
I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.
I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".
puts "hi"
a = [4,3,2]
a.each do |each_argument|
puts each_argument
end
If you're getting the error(see the image below) - Bad wkhtmltopdf's path: /usr/bin/wkhtmltopdf
when using the wkhtmltopdf
gem in your rails app to convert an HTML page to a PDF file. Following the below steps should help you get it working on your machine -
wkhtmltopdf
gem. For me this was located at -
/Users/my_user_name/.rvm/gems/ruby-2.1.2@gemset_name/gems/wkhtmltopdf-0.1.2/bin
darwin
version of the bin file. Do a sudo cp wkhtmltopdf_darwin_386 /usr/bin/wkhtmltopdf
.
SE No | Command | Action |
---|---|---|
1 | cmd + option + down arrow | Go to Definition(a new feature in ST3) |
2 | cmd + ctrl + g | Select all occurrences of a word within a file at once |
3 | cmd + d | Selects the next occurence of the same word |
4 | Hold cmd key and click on multiple lines to get multiple cursors | Allows for editing multiple things at a time |
5 | cmd + ctrl + p | Open a project(once saved via Project(Prj) -> Save Prj as) |
6 | cmd + ] | Indents the highlighted code towards the right |
7 | cmd + [ | Indents the highlighted code towards the left |
8 | cmd + r | Search for a method |
/* Abbreviations used : | |
L - Learning */ | |
Question on hand - | |
/* | |
If computerChoice is between 0 and 0.33, make computerChoice equal to "rock". | |
If computerChoice is between 0.34 and 0.66, make computerChoice equal to "paper". | |
If computerChoice is between 0.67 and 1, make computerChoice equal to "scissors". | |
*/ |
{ | |
"check_for_rvm": true | |
} |
filename.rb
file for which you’d like to create a filename_spec.rb
rspec --init
from the same working directory as to where you have filename.rb.rspec
file for youspec_helper.rb
where you need continually require
the ruby files that you would want to write specs forfilename_spec.rb
within the spec directory.rspec
file to add the option: --format documentation
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |