I hereby claim:
- I am jasdeepsingh on github.
- I am jasdeep (https://keybase.io/jasdeep) on keybase.
- I have a public key whose fingerprint is 6550 3A83 EAC2 9730 5A82 095C CC82 3B63 DB9B 2E7F
To claim this, I am signing this object:
var string = "my string where i'll count the occurrences"; | |
var arr = string.split(""); | |
obj = {}; | |
arr.forEach(function(elem) { obj[elem] = 0 }); | |
arr.forEach(function(elem) { obj[elem]++ }); |
# Ruby problem exercise from: http://www.rubeque.com/problems/a-man-comma--a-plan-comma--a-canal--panama-excl- | |
# We've covered the above problem at Brainstation Toronto: Backend Programming - First Cohort. (http://brainstation.it) | |
# The following solution is O(N^2) | |
# I've deliberately kept is as such (O(N^2)) so as to make sure | |
# It's easier to explain to the students. | |
def palindrome?(str) | |
str == str.reverse |
I hereby claim:
To claim this, I am signing this object:
// in router | |
angular.module('app-name', [], function($routeProvider, $locationProvider, UserService) { | |
$routeProvider. | |
when('/user/:userName', { | |
templateUrl: 'userShowPage', | |
controller: UserController, | |
resolve: { | |
//resolve functions here... | |
loadedUser: UserController.resolve.loadUser |
class Notifier | |
def notify(user) | |
if user.student? | |
send_sms(user.number) | |
elsif user.parent? | |
send_email(user.email) | |
end | |
end | |
Implement a Class, name it RecentFiles
You can start implementing your class from 2nd line onwards.
You can run the test code, which will test your code using the following command: rspec file_name.rb
You can replace the file_name.rb
with your actual file which you are working with.
If you get any errors such as rspec not found
etc, please do: sudo gem install rspec
The class should be able to handle the following scenarios:
=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') |
#====== Implement your solution below: | |
# class RecentFiles | |
# end | |
#====== Solution implementation ends | |
require 'rspec' |
http://ruby-doc.org/core-2.2.0/File.html#method-c-directory-3F
Loop Recursively Until no Directories are left to loop over.
Use File.read
to read the YML file one at a time.
require 'yaml' module to start using it.
Use the YAML
module's load
method to convert the YAML into a Ruby data structure, ie: Hash
cd ~/src | |
git clone git://github.com/masterkain/ImageMagick-sl.git | |
cd ImageMagick-sl | |
sh install_im.sh | |
sudo gem install rmagick |