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 "instagram" | |
Instagram.configure do |config| | |
config.client_id = "YOUR CLIENT ID HERE" | |
config.access_token = "YOUR ACCESS TOKEN HERE" | |
end |
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
# created a method name 'encode' that accept an argument 'string' | |
# and then call the "pack('m')" method on the string | |
def encode string | |
[string].pack("m") | |
end | |
# assign encode value of 'I love food' to string_encode variable. | |
puts string_encode = encode("I love food") # the return value is 'SSBsb3ZlIGZvb2Q=' | |
# encoding strings is pretty cool, but how do you decode them? |
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
Name: Sharnie Ivery | |
Github: http://github.com/sharnieivery | |
Blog: http://brooklynrails.com/ | |
Tagline: Always Be Coding | |
Profile Picture: http://brooklynrails.com/wp-content/uploads/2014/04/397276_112023625584347_308435430_n.jpg | |
Treehouse Account: http://teamtreehouse.com/sharnie | |
CoderWall Account: https://coderwall.com/sharnieivery | |
CodeSchool Account: https://www.codeschool.com/users/469042 | |
Favorite Websites: |
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
"sharnie".each_char do |char| | |
puts char.ord-97 # 97 specify where to start on the ascii table | |
end |
NewerOlder