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
So what are you working on? | |
Have you raised funding? | |
What makes new users try you? | |
What competition do you fear most? | |
What's the worst thing that has happened? | |
Will you reincorporate as a US company? | |
What's an impressive thing you have done? | |
Where is the rocket science here? | |
Why did you pick this idea to work on? | |
Why do the reluctant users hold back? |
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 'pdf-reader' | |
require 'date' | |
def get_name(pdf_filename) | |
reader = PDF::Reader.new(pdf_filename) | |
text = reader.pages.first.text.split(" ") | |
name = text[5] + " " + text[6] | |
end | |
def rename_pdf(original_file, name) |
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 '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 |
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
#!/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 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 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 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 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 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 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}" |