This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>My Portfolio</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.0/css/foundation.min.css"> | |
<link rel="stylesheet" href="/base.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> |
This file contains hidden or 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
<div class="row"> | |
<div class="small-12 columns"> | |
<ul class="menu"> | |
<li><a href="#">Navigation 1</a></li> | |
<li><a href="#">Navigation 2</a></li> | |
<li><a href="#">Navigation 3</a></li> | |
</ul> | |
</div> | |
</div> |
This file contains hidden or 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 is just a simple example on how to use puts | |
puts "Hello World!" | |
puts "This is fun!" | |
puts "Yahooo! Printing." | |
puts "I'd much rather you 'not'." | |
puts 'I "said" do not touch this.' | |
puts "This is a string interpolation test #{1 + 1}" |
This file contains hidden or 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
# We require the minitest library | |
require 'minitest/autorun' | |
# CLASS DEFINITION | |
class Person | |
attr_accessor :age, :name | |
def say(name) | |
"Hi, my name is test blablabla #{name}" | |
end |
This file contains hidden or 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
# We require the unit testing module of Ruby | |
require 'minitest/autorun' | |
# # Class Definition | |
class Person | |
def say(name) | |
"Hello, my name is #{name} World" | |
end | |
end |
This file contains hidden or 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 'curb' | |
count = 0 | |
while count | |
puts "Getting E-Mail #{count}" | |
email = Curl::Easy.perform("https://www.wikileaks.org/podesta-emails/get/#{count}") | |
if email.body_str.include?('<h1>Internal Server Error</h1>') | |
puts "Reached final e-mail" |
This file contains hidden or 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 'pry' | |
require 'rmagick' | |
require 'pathname' | |
require 'rake/pathmap' | |
include Magick | |
Dir.glob('./authors/*.jpg').map do |file| | |
pn = Pathname.new(file) | |
out_file = "./cropped/#{pn.basename}" |
This file contains hidden or 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 'i18n' | |
require 'fileutils' | |
I18n.available_locales = [:en] | |
Dir.glob('./authors/*.jpg').map do |orig| | |
dest = I18n.transliterate(orig.downcase.tr(' ', '-').tr('_', '-')) | |
File.rename(orig, dest) | |
end |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'typhoeus' | |
Dir.mkdir('mail') unless Dir.exist?('mail') | |
def last_email | |
Dir.entries('mail').last.scan(/\d/).join('').sub!(/^0+/, '').to_i | |
end | |
def write_email(id, body) |
This file contains hidden or 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 'pry' | |
# 1 - First we define the Car class | |
class Car | |
end | |
# 2 - Every class needs a so called initializer method | |
class Car | |
def initialize | |
end |