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 'base64' | |
class String | |
def im_your_father | |
Base64.decode64("Tk9PT29vb09PT09vb09PT09Pb29vT09Pb29v") | |
end | |
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
class Duck | |
def talk | |
puts "quack!" | |
end | |
end | |
class Cow | |
def talk | |
puts "mooo!" | |
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
<body> | |
<div class="container" data-role="page" data-add-back-btn="true" class"page-map"> | |
<header data-role="header" data-position="fixed" class="classHeader"> | |
<a href="/directions/services" data-inline="true" data-role="button">Direcciones</a> | |
</header> | |
<div id="main" role="main" data-role="content"> | |
<div class='map_canvas' id='map_canvas'></div> |
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
show the Dungeons and Bosses party | |
Yaraher is playing now | |
Yaraher is playing now as a Sorcerer | |
Yaraher gains a new level | |
Yaraher gains Ruby Control Mastery | |
Yaraher gains Ruby Control Mastery Level 4 | |
Yaraher learns Ruby Exceptions Level 2 |
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
# >---------------------------------------------------------------------------< | |
# | |
# _____ _ _ __ ___ _ | |
# | __ \ (_) | \ \ / (_) | | | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | | |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | | |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | | |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_| | |
# | |
# This template was generated by RailsWizard, the amazing and awesome Rails |
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
--view, assuming it's named "numbers/number.html.erb" | |
<%= form_tag "/somewhere" do %> | |
<%= text_field_tag "number %> | |
<%= submit_tag "Send" %> | |
<%= submit_tag "Send2" %> | |
<% end %> | |
<% if @result %> | |
<%= @result %> |
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
c = [["student","sam"], ["student","george"], ["teacher","matz"]] | |
c.uniq!{ |s| s.first } #=> [["student", "sam"], ["teacher", "matz"]] |
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
class Toss | |
attr_accessor :cubes | |
#Toss | |
def groups_size(n) | |
counts = cubes.group_by(&:face_up).map { |face, cubes| [face, cubes.size] } | |
counts.select { |face, count| count == n }.map(&:first) | |
end | |
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
# Original | |
(self.index('"') == 2 || self.index("'") == 2) ? true : false | |
# First iteration | |
[self.index('"'),self.index("'")].include? 2 ? true : false | |
# Second iteration | |
[self.index('"'),self.index("'")].include? 2 # de por sí ya eso retorna true o false | |
# Third iteration, self isn't needed |
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
# Python | |
from twython import Twython | |
usuario = "ajamaica" | |
twitter = Twython() | |
followers = twitter.getFollowersIDs( screen_name = usuario ) | |
for follower_id in followers : | |
print "Usuario %d sigue a %s" % (follower_id,usuario) |