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
$('#comments').prepend("<%= j render partial: 'comment', locals: {comment: @comment} %>"); | |
$('.counter').html("<%= j pluralize(@challenge.comments_count, 'comment')%> posted"); | |
$('.comment-box:first').animate({backgroundColor: "rgba(45,195,89,0.2)"}, 50); | |
$('.comment-box:first').delay(1000).animate({backgroundColor: "#FFFF"}, 1000); |
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 'open-uri' | |
require 'nokogiri' | |
html_file = open("http://www.leboncoin.fr/annonces/offres/ile_de_france/?q=treteau") | |
html_doc = Nokogiri::HTML(html_file) | |
html_doc.search('.lbc').each do |element| | |
puts element.search('.title').inner_text | |
puts element.search('.category').inner_text | |
puts element.search('.price').inner_text |
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 CreatePosts < ActiveRecord::Migration | |
def up | |
create_table :posts do |t| | |
t.string :name | |
t.datetime :date | |
t.string :source_url | |
t.integer :rating | |
end | |
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
<table> | |
<tr> | |
<td>Pays</td> | |
<td>Classement FIFA</td> | |
<td>Capitaine</td> | |
<td>Sélectionneur</td> | |
</tr> | |
<tr> | |
<td>France</td> |
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
def pick_number() | |
puts "pick a number please" | |
gets.chomp.to_i | |
end | |
def display_grid(grid) | |
grid.each_with_index do |num, index| | |
puts "Numero #{index + 1} => #{num}" | |
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
def state_of_the_nail(length) | |
two_digit_length = (length * 100).truncate / 100.0 | |
return "La longueur du clou est de #{two_digit_length} cms" | |
end | |
def hit_nail(length, force) | |
# Give nail length and player force in input, e.g 8, 3 | |
# return new nail's length | |
return length - force * rand(0..1.0) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>KITTY BLOG | Home</title> | |
<meta charset="utf-8"> | |
<meta name="description" content="KittyBlog, best cat blog in the world"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<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
<html> | |
<head> | |
<title>MON LAYOUT</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div id="navbar"> | |
<div class="nav-content"> | |
<h1>MY BLOG</h1> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>--- TODO ---</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> |
OlderNewer