Skip to content

Instantly share code, notes, and snippets.

View roadev's full-sized avatar
🎯
Focusing

Juan Roa roadev

🎯
Focusing
View GitHub Profile
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 / puma.service
Created June 12, 2018 23:44 — forked from arteezy/puma.service
Manage Puma with systemd on Ubuntu 16.04 and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
auth_key: [*('a'..'z'),*('0'..'9'),*('A'..'Z')].shuffle[0, 32].join

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.

Data

const a = [1, 3, 4, 6, 12, 15, 23, 20];

const b = ['a', 'once a time', 'machine learning', 'beer', 'bear', 'beat'];

const c = [ { key1: 'abc' }, { key2: 1.2 }, { key3: false }, { key4: null }, { key5: undefined }, { key6: '' } ];

Challenges

Data

const i = fromJS(
  { name: 'Juan', age: 25 },
  { name: 'David', age: 34 },
  { name: 'Luis', age: 28 },
  { name: 'Andrés', age: 29 },
);
  1. Use the React Toolbox Card component for each post.
  2. Use the "Dame click" button to show/hide the comments component and rename with an appropiate name.
  3. Implement flexbox (pure CSS) for input styling (1 row, 2 columns)
  4. Define the data structure for a Post.

Resources

bVXkiypFhqQ84sC9gTdrEj16TyQqK39XPG
0x4331bBE946B10428e7a2d57838443a527e2f6f55
@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