Skip to content

Instantly share code, notes, and snippets.

View roadev's full-sized avatar
🎯
Focusing

Juan Roa roadev

🎯
Focusing
View GitHub Profile
@roadev
roadev / Space Invaders Game ( 404 ).markdown
Created April 10, 2016 20:07
Space Invaders Game ( 404 )
@roadev
roadev / Dockerfile
Created September 19, 2016 01:56
Dockerfile for building magento 1.x development environment
FROM php:5.6-apache
RUN apt-get update && apt-get install -y \
libmcrypt-dev \
libxml2-dev \
libpng12-dev \
libjpeg-dev
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install mcrypt
RUN docker-php-ext-install soap
require 'csv'
CSV.foreach('app/services/rg_list.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase, gender: row['Gender'].to_s.downcase
end
CSV.foreach('app/services/rg17_register_full.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase.strip, gender: row['Gender'].to_s.downcase, register_date: row['register_date'].to_s.downcase, birth_date: row['birth_date'].to_s, phone: row['phone'].to_s.downcase.strip, level: row['level'].to_s.downcase, motivation: row['motivation'].to_s.downcase, heard_ror: row['heard_ror'].to_s.downcase, laptop: row['laptop'].to_s.downcase, so: row['so'].to_s.downcase, expectation: row['expectation'].to_s.downcase, how_did_you_find_it: row['how_did_you_find_it'].to_s.downcase
end
@roadev
roadev / grid.css
Created January 14, 2017 20:56
flexbox based grid
.col-0, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
flex: 0 0 auto;
padding: 0 1% 0 1%;
}
.container {
CSV.open("file.csv", "wb") do |csv|
csv << ["Name", "Phone"]
people = Person.by_role("assistant").by_gender("f").by_days("vs")
people.each do |p|
p.phone[5..9] = "xxxxx"
csv << [p.name, p.phone]
end
people = Person.by_role("assistant").by_gender("f").by_days("s")
people.each do |p|
csv << [p.name, p.phone]
@roadev
roadev / gist:397d669f3c391fd31f81c6edaeec1f7e
Created March 29, 2017 16:38 — forked from incredimike/variousCountryListFormats.js
Country list as javascript array (alphabetical)
// This needs tidied up before production TODO
var country_list = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua &amp; Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas"
,"Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia &amp; Herzegovina","Botswana","Brazil","British Virgin Islands"
,"Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica"
,"Cote D Ivoire","Croatia","Cruise Ship","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea"
,"Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana"
,"Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","G
0x4331bBE946B10428e7a2d57838443a527e2f6f55
bVXkiypFhqQ84sC9gTdrEj16TyQqK39XPG

Basic knowledge

  1. Create a comment component with name, email, country, age props and integrate it to Post component
  2. Create a list of comments by post and show it in each post.
  3. Add a button to show/hide the comments component.
  4. If there's not comments in a post, show the message "This post has not comments".
  5. Create a component with a form with 4 input fields: name, email, country, age (validate input types).
  6. Render the comments form (the component created in the step 5) below the comments component in each Post.
  7. Use an stylesheet and apply the styles that you consider for each component.