diff --git a/app.rb b/app.rb index 521d3ed..62aaee3 100644 --- a/app.rb +++ b/app.rb @@ -1,8 +1,8 @@ require 'sinatra' require './lib/profile' -set :application_id, 'EDIT_ME' -set :secret, 'EDIT_ME' +set :application_id, '7e16da8b68d5bf0c63f71535351d4a9da6ce6aff1b602f82788138aef009d42d' +set :secret, '6212562da0927a6ed927cfbfbd1f59d585d8f3b719463a0d4542b688d4d3c7d1' set :redirect_uri, 'http://localhost:4567/callback' set :site_url, 'https://wegotcoders.com' set :session_secret, 'secret' diff --git a/primes.rb b/primes.rb index ec74770..a62a3e2 100644 --- a/primes.rb +++ b/primes.rb @@ -1,6 +1,33 @@ class Primes def self.sum_to(limit = 100) # TODO - add your prime number solution here... - "I'm working on it!" + +num = 1 +last = 100 +primes = [] + +while (num <= last) + condition = true + x = 2 + + while (x <= num / 2) + if (num % x == 0) + condition = false + break + end + + x = x + 1 + end -end \ No newline at end of file + + if condition && num > 1 + + primes << num + + end + + num = num + 1 + +end + +print primes.inject(:+) diff --git a/public/images/codecademy.png b/public/images/codecademy.png new file mode 100644 index 0000000..79a3ed4 Binary files /dev/null and b/public/images/codecademy.png differ diff --git a/public/images/picture.JPG b/public/images/picture.JPG new file mode 100644 index 0000000..0bd594c Binary files /dev/null and b/public/images/picture.JPG differ diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 1ef5a44..f5c4604 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -1,20 +1,75 @@ +header, footer { + padding: 1em; + color: black; + background-color: orange; + clear: left; + text-align: center; +} + + +.newspaper { + -webkit-column-count: 3; /* Chrome, Safari, Opera */ + -moz-column-count: 3; /* Firefox */ + column-count: 3; + -webkit-column-gap: 40px; /* Chrome, Safari, Opera */ + -moz-column-gap: 40px; /* Firefox */ + column-gap: 40px; + -webkit-column-rule: 1px solid lightblue; /* Chrome, Safari, Opera */ + -moz-column-rule: 1px solid lightblue; /* Firefox */ + column-rule: 1px solid lightblue; +} + +h3 { + -webkit-column-span: all; /* Chrome, Safari, Opera */ + column-span: all; +} + +* { + padding: 0; + margin: 0; + } + .fit { /* set relative picture size */ + max-width: 100%; + max-height: 100%; + } + .center { + display: block; + margin: auto; + } + + body { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; line-height: 1.428571429; color: #333; + width: 50%; + margin: auto; } -#logo { +table, th{ + border: 0px solid black; + border-collapse: collapse; + text-align: left; +} + +table, td{ + text-align: center; } + +} +#logo { + text-align: right; +} + #content { padding: 1em; } .box { - border: 1px solid #999; + border: 0px solid #999; background: #FCFCFC; padding: 1em; margin-bottom: 0.5em; @@ -27,13 +82,13 @@ body { h3 { font-size: 1.5em; } - +h4{ + font-style: bold; +} .error { text-align: center; } .error h2 { font-size: 1.5em; -} - -/* TODO - Add your own styles here */ +} \ No newline at end of file diff --git a/views/index.erb b/views/index.erb index 44368ca..f711aeb 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,13 +1,188 @@ -<% if @profile %> -

<%= @profile["first_name"] %>'s Amazing Profile

- - <% @profile.each do |field, value| %> -
-

<%= field %>

-

<%= value %>

+ + + + + + + We Got Coders - My Amazing Application + + + + + + + + + + + + + + + + +
+ + + +2nd Page + +
+ +

Tudor-Dan's Supercalifragilisticexpialidocious Profile

+ +
+ + + +
+ +

ID: 2976

+
+ +
+

Email: tudordanp@gmail.com

+
+ +
+

First name: Tudor-Dan

+ +
+ +
+

Last name: Petrescu

+
+ +
+

Phone number: 07496093640

+
+ +
+

Gender: Male

+ +
+ +
+

DOB: + + +

+ +
+ +
+

Twitter: cowilkscow

+ +
+ +
+

Github: cowmilkscow

+ +
+ +
+

Nickname: MotherBoard

+
- <% end %> + +
+ + +
+
+
+

About Me:

+ My name is Tudor-Dan Petrescu. I am the kind of a person that continuously challenges himself. Whenever I feel that I am stuck in my comfort zone, I try to run from it. I am always looking for ways to improve and develop myself in order to never stop growing as a person and as a professional. I have studied marketing because of my creative side, believing that this will be a good way of putting my aptitudes in value, and I was right. Before leaving Romania to study an MSc in Uk, I had my own advertising company and had been in charge of another company helping it grow and develop in a profitable business. I love writing, being in nature, honesty, and reality. +
+
+
+
+
+

Projects:

+ I have done a C++ course that helped me understand better what coding is about. I have done a few websites in HTML and a bit of javascript. My best experience with a programming project, was before I knew too much about it, I gave a solution to the IT department while they were developing a web app and got stuck. I can say that was the point when I discovered that I want to know more about the subject. +
+
+
+
+
+

Rationale:

+ I found my passion for programming when I was doing HTML web pages, but they were too simple and I tried to look a bit in Javascript. What made me so interested was the challenge of understanding how things are created in machine language, and how it works, from code to reality. I want to apply to this program because I think I can combine what I have studied with programming and all my experience will help me, master this domain in time. I find it extremely interesting and addictive to read, understand and write code, and because this will be a structured way of learning what I want. +
+
+
+
+
+

Ambition:

+ I want to improve and enrich my knowledge in order to be able to put my creativity to a good use. I want to be able to create web applications. To have a better understanding of programming languages, other than C++. I want to understand databases better, and how to work with them. + +
+
+
+
+ +
+ +

Learning experience:

+ Having a nice environment with people that are willing to share their experience and knowledge. +Working on various assignments in teams, in order to have a better understanding of the learning material. +Plenty examples from practical applications of the things we learn. + + +
+
+
+ +
+
+ +

How did you hear:

+ From a friend, that found the ad through the university job site. + +
+
+
+

How about the future?

+ +
+ + +
+
+ +
+

Primes sum

+

1060

+
+

Stats

@@ -15,9 +190,10 @@ 0 words found.
+
@@ -27,7 +203,7 @@
- "/> +
@@ -36,13 +212,9 @@
-<% else %> -
-

Welcome! Once you have updated the OAuth tokens, the link below will fetch your profile information.

- Authorise -
-<% end %> +
+ @@ -55,5 +227,18 @@ // TODO - Count the number of words in the profile. // hint - look at what the innerHTML property provides. - document.getElementById('word-count').innerHTML = total_words; - \ No newline at end of file + document.getElementById('word-count').innerHTML = total_words; + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/views/mypage.erb b/views/mypage.erb new file mode 100644 index 0000000..ccc4f47 --- /dev/null +++ b/views/mypage.erb @@ -0,0 +1,97 @@ + + + + + + + We Got Coders - My Amazing Application + + + + + +
+ + + +1st Page + +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + + +
+ + + + +

+ + +
+ + + \ No newline at end of file diff --git a/views/primes.erb b/views/primes.erb index 335fa00..8aa78a6 100644 --- a/views/primes.erb +++ b/views/primes.erb @@ -1,7 +1,82 @@ -

Prime Numbers

+ + + + + + + We Got Coders - My Amazing Application + + + + + +
+ + + +2nd Page + +
+ + + + + + + +

Sum:

+ + + + + + + + -Sum : <%= @sum %>
- Back -
\ No newline at end of file +

Back

+ + + + + + + + + + + + \ No newline at end of file diff --git a/views/public/images/codecademy.png b/views/public/images/codecademy.png new file mode 100644 index 0000000..3f958a6 Binary files /dev/null and b/views/public/images/codecademy.png differ diff --git a/views/public/images/logo.png b/views/public/images/logo.png new file mode 100644 index 0000000..6a955a0 Binary files /dev/null and b/views/public/images/logo.png differ diff --git a/views/public/images/picture.JPG b/views/public/images/picture.JPG new file mode 100644 index 0000000..0bd594c Binary files /dev/null and b/views/public/images/picture.JPG differ diff --git a/views/public/stylesheets/main.css b/views/public/stylesheets/main.css new file mode 100644 index 0000000..f5c4604 --- /dev/null +++ b/views/public/stylesheets/main.css @@ -0,0 +1,94 @@ +header, footer { + padding: 1em; + color: black; + background-color: orange; + clear: left; + text-align: center; +} + + +.newspaper { + -webkit-column-count: 3; /* Chrome, Safari, Opera */ + -moz-column-count: 3; /* Firefox */ + column-count: 3; + -webkit-column-gap: 40px; /* Chrome, Safari, Opera */ + -moz-column-gap: 40px; /* Firefox */ + column-gap: 40px; + -webkit-column-rule: 1px solid lightblue; /* Chrome, Safari, Opera */ + -moz-column-rule: 1px solid lightblue; /* Firefox */ + column-rule: 1px solid lightblue; +} + +h3 { + -webkit-column-span: all; /* Chrome, Safari, Opera */ + column-span: all; +} + +* { + padding: 0; + margin: 0; + } + .fit { /* set relative picture size */ + max-width: 100%; + max-height: 100%; + } + .center { + display: block; + margin: auto; + } + + +body { + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 14px; + line-height: 1.428571429; + color: #333; + width: 50%; + margin: auto; +} + +table, th{ + border: 0px solid black; + border-collapse: collapse; + text-align: left; +} + +table, td{ + + text-align: center; +} + + +} +#logo { + text-align: right; +} + +#content { + padding: 1em; +} + +.box { + border: 0px solid #999; + background: #FCFCFC; + padding: 1em; + margin-bottom: 0.5em; +} + +.welcome { + text-align: center; +} + +h3 { + font-size: 1.5em; +} +h4{ + font-style: bold; +} +.error { + text-align: center; +} + +.error h2 { + font-size: 1.5em; +} \ No newline at end of file diff --git a/views/public/stylesheets/reset.css b/views/public/stylesheets/reset.css new file mode 100644 index 0000000..cf3d1dd --- /dev/null +++ b/views/public/stylesheets/reset.css @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file