├── Web-Development ├── HTML-CSS │ ├── HTML_Structure_1 │ │ ├── file.md │ │ ├── HTML_Basics_2 │ │ │ ├── 2.html │ │ │ ├── 14.html │ │ │ ├── 1.html │ │ │ ├── 15.html │ │ │ ├── 11.html │ │ │ └── 13.html │ │ └── Social_Networking_Profile │ │ │ └── 3.html │ ├── Introduction-to-HTML │ │ ├── Readme.md │ │ ├── Build_Own_Webpage │ │ │ ├── 1.html │ │ │ ├── 3.html │ │ │ ├── example.html │ │ │ ├── 2.html │ │ │ └── 4.html │ │ └── HTML_Basics_1 │ │ │ └── yahoo.jpg │ ├── Introduction-to-CSS │ │ ├── CSS_Overview │ │ │ ├── 7.css │ │ │ ├── 20.css │ │ │ ├── 8.css │ │ │ ├── 2.css │ │ │ ├── 3.css │ │ │ ├── 10.css │ │ │ ├── 9.css │ │ │ ├── 3.html │ │ │ ├── 16.css │ │ │ ├── 6.html │ │ │ └── 21.html │ │ └── Design_Website_Button │ │ │ ├── 2.css │ │ │ ├── 4.css │ │ │ └── 1.css │ ├── HTML-Structure-2 │ │ ├── Clickable_Photo_Page │ │ │ ├── 1.css │ │ │ ├── stylesheet.css │ │ │ ├── stylesheet2.css │ │ │ ├── 2.html │ │ │ ├── 1.html │ │ │ └── 3.html │ │ └── HTML_Basics_3 │ │ │ ├── stylesheet.css │ │ │ ├── 14.html │ │ │ ├── 13.html │ │ │ ├── 2.html │ │ │ └── 12.html │ ├── CSS - Classes & IDs │ │ ├── CSS Selectors │ │ │ ├── 17.css │ │ │ ├── 9.css │ │ │ ├── 1.html │ │ │ └── 16.html │ │ └── Sorting Friends │ │ │ ├── 5.css │ │ │ ├── 7.css │ │ │ ├── 1.css │ │ │ ├── 2.html │ │ │ ├── 7.html │ │ │ ├── 5.html │ │ │ └── 8.html │ ├── CSS - Element Positioning │ │ ├── 15.css │ │ ├── 17.css │ │ ├── 20.css │ │ ├── 18.css │ │ ├── 19.css │ │ ├── 2.css │ │ ├── 3.css │ │ ├── 16.css │ │ ├── 15.html │ │ ├── 20.html │ │ ├── 17.html │ │ ├── 19.html │ │ └── 3.html │ └── Build-Resume │ │ └── 5.html ├── PHP │ ├── Readme.md │ ├── Introduction_PHP │ │ ├── 1.css │ │ ├── 5.php │ │ ├── 7.php │ │ ├── 10.php │ │ ├── 12.php │ │ ├── 13.php │ │ ├── 8.php │ │ └── 6.php │ ├── Arrays │ │ ├── 3.php │ │ └── 5.php │ ├── While Loops │ │ ├── 3.php │ │ └── 7.php │ ├── Control Flow │ │ ├── 1.php │ │ └── 6.php │ ├── Conditionals │ │ └── 1.php │ ├── Functions II │ │ ├── 3.php │ │ ├── 4.php │ │ ├── 1.php │ │ └── 7.php │ ├── For Loops │ │ ├── 1.php │ │ └── 7.php │ ├── Advanced Arrays │ │ └── 1.php │ └── Object Oriented PHP │ │ └── 1.php ├── Ruby │ ├── readme.md │ ├── 8- Histogram │ │ ├── 2.rb │ │ ├── 3.rb │ │ ├── 4.rb │ │ ├── 5.rb │ │ └── 1.rb │ ├── 5- Loops & Iterators │ │ ├── 7.rb │ │ ├── 18.rb │ │ ├── 5.rb │ │ ├── 16.rb │ │ ├── 15.rb │ │ ├── 17.rb │ │ ├── 10.rb │ │ ├── 13.rb │ │ ├── 14.rb │ │ ├── 3.rb │ │ ├── 12.rb │ │ ├── 6.rb │ │ ├── 1.rb │ │ ├── 11.rb │ │ ├── 9.rb │ │ └── 2.rb │ ├── 7- Data Structures │ │ ├── 3.rb │ │ ├── 1.rb │ │ ├── 14.rb │ │ ├── 15.rb │ │ ├── 5.rb │ │ ├── 8.rb │ │ ├── 9.rb │ │ ├── 7.rb │ │ ├── 4.rb │ │ ├── 16.rb │ │ └── 11.rb │ ├── 4-Thith │ │ ├── 1.rb │ │ ├── 6.rb │ │ ├── 7.rb │ │ ├── 4.rb │ │ └── 5.rb │ ├── 3-Control Flow │ │ ├── 15.rb │ │ ├── 14.rb │ │ ├── 6.rb │ │ └── 5.rb │ ├── 6- Redacted │ │ ├── 2.rb │ │ ├── 4.rb │ │ ├── 3.rb │ │ └── 1.rb │ ├── 9- Methods, Blocks & Sorting │ │ ├── 3.rb │ │ └── 4.rb │ ├── 1-Introduction │ │ ├── 9.rb │ │ ├── 5.rb │ │ ├── 8.rb │ │ ├── 3.rb │ │ ├── 12.rb │ │ ├── 6.rb │ │ ├── 7.rb │ │ ├── 11.rb │ │ └── 10.rb │ └── 2-Form in Formatter │ │ ├── 4.rb │ │ └── 2.rb ├── React │ ├── React-I │ │ ├── 2-React-Components │ │ │ ├── 1-First-React-Component │ │ │ │ ├── 9.js │ │ │ │ ├── 7.js │ │ │ │ ├── 2.js │ │ │ │ ├── 3.js │ │ │ │ ├── 6.js │ │ │ │ ├── 8.js │ │ │ │ ├── 10.js │ │ │ │ ├── 1.js │ │ │ │ ├── 4.js │ │ │ │ └── 5.js │ │ │ ├── 3-Authorization-Form-Project │ │ │ │ ├── 9-compiled.js │ │ │ │ ├── 9-compiled.js.map │ │ │ │ ├── index.html │ │ │ │ ├── 5-compiled.js │ │ │ │ ├── 5-compiled.js.map │ │ │ │ ├── 7-compiled.js │ │ │ │ ├── 7-compiled.js.map │ │ │ │ ├── 8-compiled.js │ │ │ │ ├── 8-compiled.js.map │ │ │ │ ├── 6-compiled.js │ │ │ │ └── 6-compiled.js.map │ │ │ └── 2-Components-Advanced-JSX │ │ │ │ ├── 5.js │ │ │ │ ├── 6.js │ │ │ │ ├── 2.js │ │ │ │ ├── 4.js │ │ │ │ ├── 1.js │ │ │ │ └── 3.js │ │ ├── 3-Components-Interacting │ │ │ ├── 2-This.Props │ │ │ │ ├── 7-Button.js │ │ │ │ ├── 8-Button.js │ │ │ │ ├── 10-Button.js │ │ │ │ ├── 6-Home.js │ │ │ │ ├── 4.js │ │ │ │ ├── 6-Greeting.js │ │ │ │ ├── 11-List.js │ │ │ │ ├── 1.js │ │ │ │ ├── 2.js │ │ │ │ ├── 9-Talker.js │ │ │ │ └── 5-Greeting.js │ │ │ ├── 3-This.State │ │ │ │ ├── 3.js │ │ │ │ └── 1.js │ │ │ └── 1-Components-render-other-components │ │ │ │ ├── 3-navbar.js │ │ │ │ ├── 1.js │ │ │ │ └── 2.js │ │ └── Project-Color-Picker │ │ │ └── button.js │ └── React-II │ │ ├── 3-Child-Update-Siblings │ │ ├── 2-Sibling.js │ │ ├── 3-Sibling.js │ │ ├── 5-Sibling.js │ │ ├── 2-Child.js │ │ ├── 3-Child.js │ │ ├── 5-Child.js │ │ ├── 4-Child.js │ │ ├── 1.js │ │ └── 4-Parent.js │ │ ├── 2-Child-Update-Parent │ │ ├── 1-Step3.js │ │ ├── 1-Step2.js │ │ ├── 2-Child.js │ │ └── 3-Child.js │ │ └── 1-Stateless-Stateful │ │ └── 2.js ├── Ruby-On-Rails │ ├── 1 - Getting Started │ │ ├── Project-Broadway │ │ │ ├── pages_controller.rb │ │ │ └── pages.css.scss │ │ ├── Project-Bolt-Network │ │ │ ├── pages_controller.rb │ │ │ ├── application.html.erb │ │ │ └── about.html.erb │ │ ├── 6.md │ │ ├── 4.md │ │ ├── 5.md │ │ └── 2.md │ ├── 3 - Associations I │ │ └── 1.md │ └── 2 - Saving Data │ │ ├── 7.md │ │ └── 2.md ├── jQuery │ ├── Dynamic HTML │ │ ├── 6.js │ │ ├── 10.css │ │ └── 6.css │ ├── Project-Birdman │ │ └── app.js │ ├── jQuery Events │ │ ├── 6.css │ │ ├── 2.html │ │ └── 3.html │ ├── Introduction │ │ ├── 1.css │ │ ├── 1.js │ │ ├── 1.html │ │ ├── 5.html │ │ └── 10.html │ ├── Project-Feedster │ │ └── app.js │ ├── jQuery Effects │ │ ├── 9.css │ │ ├── 5.html │ │ ├── 3.css │ │ ├── 7.css │ │ └── 1.html │ ├── Project-Gameboard │ │ └── app.js │ ├── Project-Threadly │ │ ├── script.js │ │ └── index.html │ ├── Project-Forecast │ │ └── script.js │ ├── Project-Bonsai │ │ └── app.js │ └── Project-ListEasy │ │ └── app.js ├── SASS │ ├── 1-create-SASS-stylesheet │ │ └── index.html │ └── 2-Mixins-&-selector │ │ └── index.html └── Javascript │ ├── Objects II │ ├── 2.js │ ├── 26.js │ ├── 15.js │ ├── 6.js │ ├── 19.js │ └── 28.js │ └── Data Structures │ └── Contact List │ └── final_one.js ├── Python ├── readme.md ├── Tutorials │ ├── Lists-Functions │ │ ├── Lists_And_Functions_2.py │ │ ├── Lists_And_Functions_3.py │ │ ├── Lists_And_Functions_4.py │ │ ├── Lists_And_Functions_1.py │ │ ├── Lists_And_Functions_10.py │ │ ├── Lists_And_Functions_5.py │ │ ├── Lists_And_Functions_6.py │ │ ├── Lists_And_Functions_8.py │ │ ├── Lists_And_Functions_11.py │ │ ├── Lists_And_Functions_7.py │ │ ├── Lists_And_Functions_9.py │ │ └── Lists_And_Functions_12.py │ ├── Loops │ │ ├── while_1.py │ │ ├── while.py │ │ ├── multiple_lists.py │ │ ├── for_else.py │ │ ├── enumerate.py │ │ ├── for_dict.py │ │ └── while_2.py │ ├── Advanced-Topics │ │ ├── 17.py │ │ ├── lists2.py │ │ ├── 14.py │ │ ├── 18.py │ │ ├── 13.py │ │ └── 11.py │ ├── Bitwise-Operators │ │ ├── 13.py │ │ ├── 10.py │ │ ├── 12.py │ │ ├── 14.py │ │ ├── 9.py │ │ └── 8.py │ ├── File-IO │ │ ├── 4.py │ │ ├── 2.py │ │ └── 5.py │ └── Introduction-Classes │ │ ├── 2.py │ │ ├── 8.py │ │ └── 5.py └── Challenges │ ├── Practice │ ├── 13.py │ ├── 7.py │ ├── 12.py │ ├── 5.py │ ├── 8.py │ ├── 14.py │ └── 11.py │ └── Supermarket │ └── Supermarket.py └── README /Web-Development/HTML-CSS/HTML_Structure_1/file.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-HTML/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Web-Development/PHP/Readme.md: -------------------------------------------------------------------------------- 1 | PHP tutorials from codeacademy 2 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-HTML/Build_Own_Webpage/1.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Python/readme.md: -------------------------------------------------------------------------------- 1 | Code from the python tutorials and challenges on codeacademy -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This repository contains code from several tutorials from CodeAcademy. 2 | -------------------------------------------------------------------------------- /Web-Development/Ruby/readme.md: -------------------------------------------------------------------------------- 1 | All Ruby code from Ruby tutorials on Codeacademy! -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/7.css: -------------------------------------------------------------------------------- 1 | p{ 2 | color:green; 3 | } -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/20.css: -------------------------------------------------------------------------------- 1 | table{ 2 | border:1px solid black; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/8.css: -------------------------------------------------------------------------------- 1 | p{ 2 | color:green; 3 | font-family:Garamond; 4 | font-size:24px; 5 | } -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_2.py: -------------------------------------------------------------------------------- 1 | number = 5 2 | 3 | def my_function(x): 4 | return x * 3 5 | 6 | print my_function(number) -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/2.css: -------------------------------------------------------------------------------- 1 | p { 2 | color: red; 3 | } 4 | 5 | span { 6 | /*Write your CSS here!*/ 7 | color:blue; 8 | } -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/9.js: -------------------------------------------------------------------------------- 1 | ReactDOM.render( 2 | , 3 | document.getElementById('app') 4 | ); 5 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/Clickable_Photo_Page/1.css: -------------------------------------------------------------------------------- 1 | img { 2 | width:100px; 3 | height:100px; 4 | } 5 | 6 | table, td { 7 | border: 1px #70b8ff dashed; 8 | } -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/3.css: -------------------------------------------------------------------------------- 1 | p { 2 | font-size: 100px; 3 | } 4 | 5 | span { 6 | /*Add your CSS here!*/ 7 | font-family:cursive; 8 | } -------------------------------------------------------------------------------- /Web-Development/Ruby-On-Rails/1 - Getting Started/Project-Broadway/pages_controller.rb: -------------------------------------------------------------------------------- 1 | class PagesController < ApplicationController 2 | 3 | def home 4 | end 5 | 6 | end 7 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/Clickable_Photo_Page/stylesheet.css: -------------------------------------------------------------------------------- 1 | img { 2 | width:100px; 3 | height:100px; 4 | } 5 | 6 | table, td { 7 | border: 1px #70b8ff dashed; 8 | } -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/Clickable_Photo_Page/stylesheet2.css: -------------------------------------------------------------------------------- 1 | img { 2 | width:100px; 3 | height:100px; 4 | } 5 | 6 | table, td { 7 | border: 1px #70b8ff dashed; 8 | } -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/10.css: -------------------------------------------------------------------------------- 1 | h3 { 2 | font-family: Verdana; 3 | color: blue; 4 | } 5 | 6 | p { 7 | font-family: Garamond; 8 | font-size: 16px; 9 | } -------------------------------------------------------------------------------- /Web-Development/jQuery/Dynamic HTML/6.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#text").click(function() { 3 | $('#text').addClass("highlighted"); 4 | }); 5 | 6 | }); -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_3.py: -------------------------------------------------------------------------------- 1 | m = 5 2 | n = 13 3 | # Add add_function here! 4 | def add_function(x,y): 5 | return x + y 6 | 7 | 8 | print add_function(m, n) -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_4.py: -------------------------------------------------------------------------------- 1 | n = "Hello" 2 | # Your function here! 3 | def string_function(s): 4 | return str(s) + "world" 5 | 6 | 7 | print string_function(n) -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/7.js: -------------------------------------------------------------------------------- 1 | 2 | var componentBlueprint = { 3 | render : function() { 4 | return

Hello world

; 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-HTML/HTML_Basics_1/yahoo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Manish-Giri/CodeAcademy/HEAD/Web-Development/HTML-CSS/Introduction-to-HTML/HTML_Basics_1/yahoo.jpg -------------------------------------------------------------------------------- /Web-Development/Ruby-On-Rails/1 - Getting Started/Project-Bolt-Network/pages_controller.rb: -------------------------------------------------------------------------------- 1 | class PagesController < ApplicationController 2 | def home 3 | end 4 | def about 5 | end 6 | end 7 | 8 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/3-Authorization-Form-Project/9-compiled.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 9/17/16. 3 | */ 4 | "use strict"; 5 | 6 | //# sourceMappingURL=9-compiled.js.map -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/3-Authorization-Form-Project/9-compiled.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["9.js"],"names":[],"mappings":"AAAA","file":"9-compiled.js","sourcesContent":["/**\n * Created by manishgiri on 9/17/16.\n */\n"]} -------------------------------------------------------------------------------- /Web-Development/jQuery/Project-Birdman/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 11/9/16. 3 | */ 4 | var main = function() { 5 | $("img").click(function() { 6 | $(".dropdown-menu").toggle(); 7 | }); 8 | }; 9 | 10 | $(document).ready(main); 11 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/3-Authorization-Form-Project/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/HTML_Basics_3/stylesheet.css: -------------------------------------------------------------------------------- 1 | p { 2 | font-family:Garamond; 3 | font-size:16px; 4 | } 5 | 6 | h3 { 7 | font-family:cursive; 8 | color:#36648b; 9 | text-align:center; 10 | } 11 | 12 | span { 13 | color:#cc0000; 14 | font-size:24px; 15 | } -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_1.py: -------------------------------------------------------------------------------- 1 | n = [1, 3, 5] 2 | # Add your code below 3 | print n[1] 4 | 5 | n[1] *= 5 6 | print n[1] 7 | 8 | 9 | # Append the number 4 here 10 | n.append(4) 11 | print n 12 | 13 | # Remove the first item in the list here 14 | n.remove(1) 15 | print n -------------------------------------------------------------------------------- /Web-Development/Ruby/8- Histogram/2.rb: -------------------------------------------------------------------------------- 1 | # You Know the Drill 2 | # You know by now how we've gotta start: we need to get input from the user. 3 | 4 | # Instructions 5 | # Use a puts statement to prompt the user for input. Use gets.chomp to save this input to a variable called text. 6 | 7 | puts "Enter text" 8 | text = gets.chomp -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/7-Button.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Button = React.createClass({ 4 | render: function () { 5 | return ( 6 | 9 | ); 10 | } 11 | }); 12 | 13 | module.exports = Button; 14 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/8-Button.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Button = React.createClass({ 4 | render: function () { 5 | return ( 6 | 9 | ); 10 | } 11 | }); 12 | 13 | module.exports = Button; 14 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/7.rb: -------------------------------------------------------------------------------- 1 | # Building Your Own 2 | # Good work! You're ready to build your very own for loop. 3 | 4 | # Instructions 5 | # Write a for loop that puts the numbers 1 to 20, including 20, using either .. or .... Check Hint if you need a syntax refresher. 6 | 7 | for num in 1..20 8 | puts num 9 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/18.rb: -------------------------------------------------------------------------------- 1 | # Iterating with .times 2 | # Finally, let's replace our loop with the .times iterator. 3 | 4 | # Instructions 5 | # Use the .times iterator to print "Ruby!" to the console 30 times. Hit Save & Submit Code to see the majesty of your code and complete this lesson! 6 | 7 | 30.times {print "Ruby!"} -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/2.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | 5 | var componentBlueprint = { 6 | render : function() { 7 | return

Hello world

; 8 | } 9 | }; 10 | var MyComponentClass = React.createClass(componentBlueprint); 11 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/3.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | 5 | var componentBlueprint = { 6 | render : function() { 7 | return

Hello world

; 8 | } 9 | }; 10 | var MyComponentClass = React.createClass(componentBlueprint); 11 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/6.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | 5 | var componentBlueprint = { 6 | render : function() { 7 | return

Hello world

; 8 | } 9 | }; 10 | var MyComponentClass = React.createClass(componentBlueprint); 11 | -------------------------------------------------------------------------------- /Web-Development/jQuery/jQuery Events/6.css: -------------------------------------------------------------------------------- 1 | div { 2 | border-radius: 5px; 3 | background-color: #ABCDEF; 4 | transition: background-color 0.5s ease; 5 | display:inline; 6 | font-size:25px; 7 | padding:20px; 8 | border:1px solid #ccc; 9 | margin-top:10px; 10 | } 11 | 12 | .active { 13 | background-color:#556677; 14 | } -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/10-Button.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Button = React.createClass({ 4 | render: function () { 5 | return ( 6 | 9 | ); 10 | } 11 | }); 12 | 13 | module.exports = Button; 14 | -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_10.py: -------------------------------------------------------------------------------- 1 | # Using strings in lists in functions 2 | # Now let's try working with strings! 3 | 4 | n = ["Michael", "Lieberman"] 5 | # Add your function here 6 | 7 | def join_strings(words): 8 | result = "" 9 | for word in words: 10 | result += word 11 | return result 12 | 13 | print join_strings(n) -------------------------------------------------------------------------------- /Python/Tutorials/Loops/while_1.py: -------------------------------------------------------------------------------- 1 | choice = raw_input('Enjoying the course? (y/n)') 2 | 3 | while choice != 'y' and choice != 'n': # Fill in the condition (before the colon) 4 | choice = raw_input("Sorry, I didn't catch that. Enter again: ") 5 | 6 | count = 0 7 | 8 | while True: 9 | print count 10 | count += 1 11 | if count >= 10: 12 | break -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/8.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | 5 | var MyComponentClass = React.createClass({ 6 | render: function () { 7 | return

Hello world

; 8 | } 9 | }); 10 | 11 | ReactDOM.render(, document.getElementById('app')); 12 | -------------------------------------------------------------------------------- /Web-Development/jQuery/Introduction/1.css: -------------------------------------------------------------------------------- 1 | div { 2 | height:100px; 3 | width:100px; 4 | display: inline-block; 5 | } 6 | 7 | #red { 8 | background-color:#FF0000; 9 | } 10 | 11 | #blue { 12 | background-color:#0000FF; 13 | } 14 | 15 | #yellow { 16 | background-color:#E2BE22; 17 | } 18 | 19 | #green { 20 | background-color:#008800; 21 | } -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/10.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | 5 | var MyComponentClass = React.createClass({ 6 | render: function () { 7 | return

Hello world

; 8 | } 9 | }); 10 | 11 | ReactDOM.render(, document.getElementById('app')); 12 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/1.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var MyComponentClass = React.createClass({ 5 | render: function () { 6 | return

Hello world

; 7 | } 8 | }); 9 | 10 | ReactDOM.render( 11 | , 12 | document.getElementById('app') 13 | ); 14 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/4.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var MyComponentClass = React.createClass({ 5 | render: function () { 6 | return

Hello world

; 7 | } 8 | }); 9 | 10 | ReactDOM.render( 11 | , 12 | document.getElementById('app') 13 | ); 14 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/1-First-React-Component/5.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var MyComponentClass = React.createClass({ 5 | render: function () { 6 | return

Hello world

; 7 | } 8 | }); 9 | 10 | ReactDOM.render( 11 | , 12 | document.getElementById('app') 13 | ); 14 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/5.rb: -------------------------------------------------------------------------------- 1 | # The 'For' Loop 2 | # Sometimes you do know how many times you'll be looping, however, and when that's the case, you'll want to use a for loop. 3 | 4 | # Instructions 5 | # Take a look at the example for loop in the editor. Can you guess what it does? Click Save & Submit Code to see it in action. 6 | 7 | for num in 1...10 8 | puts num 9 | end -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Classes & IDs/CSS Selectors/17.css: -------------------------------------------------------------------------------- 1 | /*Add your CSS below!*/ 2 | p:first-child{ 3 | font-family:cursive; 4 | } 5 | 6 | p:nth-child(2) { 7 | font-family:Tahoma; 8 | } 9 | 10 | p:nth-child(3){ 11 | color:#cc0000; 12 | } 13 | 14 | p:nth-child(4){ 15 | background-color:#00ff00; 16 | } 17 | 18 | p:nth-child(5){ 19 | font-size:22px; 20 | } 21 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/Project-Color-Picker/button.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Button = React.createClass({ 4 | render: function () { 5 | return ( 6 | 10 | ); 11 | } 12 | }); 13 | 14 | module.exports = Button; 15 | -------------------------------------------------------------------------------- /Web-Development/jQuery/Project-Feedster/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 11/12/2016. 3 | */ 4 | var main = function() { 5 | $(".notification img").click(function() { 6 | $(".notification-menu").toggle(); 7 | }); 8 | 9 | $(".post button").click(function() { 10 | $(this).toggleClass("btn-like"); 11 | }); 12 | }; 13 | 14 | $(document).ready(main); 15 | -------------------------------------------------------------------------------- /Web-Development/Ruby/7- Data Structures/3.rb: -------------------------------------------------------------------------------- 1 | # Arrays of Non-Numbers 2 | # Here's something you might not have known: you can make an array of any collection of Ruby objects. You can make an array of booleans! An array of strings! The list is (almost) endless. 3 | 4 | # Instructions 5 | # Create a new array called string_array. Make it an array of... strings! 6 | 7 | string_array = ["array", "of", "strings"] -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Element Positioning/15.css: -------------------------------------------------------------------------------- 1 | div { 2 | height: 300px; 3 | width: 300px; 4 | border: 2px solid black; 5 | border-radius: 5px; 6 | background-color: #308014; 7 | /*Add your CSS here!*/ 8 | float:right; 9 | 10 | } 11 | 12 | p { 13 | font-family: Verdana, sans-serif; 14 | font-size: 20px; 15 | width: 280px; 16 | /*Add your CSS here!*/ 17 | float:left; 18 | 19 | } -------------------------------------------------------------------------------- /Web-Development/jQuery/Introduction/1.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('div').mouseenter(function() { 3 | $(this).animate({ 4 | height: '+=10px' 5 | }); 6 | }); 7 | $('div').mouseleave(function() { 8 | $(this).animate({ 9 | height: '-=10px' 10 | }); 11 | }); 12 | $('div').click(function() { 13 | $(this).toggle(1000); 14 | }); 15 | }); -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/2-Components-Advanced-JSX/5.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var MyName = React.createClass({ 5 | // name property goes here: 6 | name: "Manish", 7 | 8 | render: function () { 9 | return

My name is {this.name}.

; 10 | } 11 | }); 12 | 13 | ReactDOM.render(, document.getElementById('app')); 14 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/6-Home.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | var Welcome = require('./Welcome'); 4 | 5 | var Home = React.createClass({ 6 | render: function () { 7 | return ; 8 | } 9 | }); 10 | 11 | ReactDOM.render( 12 | , 13 | document.getElementById('app') 14 | ); 15 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/9.css: -------------------------------------------------------------------------------- 1 | /*You can do this! Write your CSS below.*/ 2 | h3 { 3 | color:red; 4 | } 5 | 6 | p{ 7 | font-family:Courier; 8 | } 9 | 10 | span{ 11 | background-color:yellow; 12 | } 13 | 14 | 15 | /*12/26*/ 16 | h1{ 17 | font-family:Verdana; 18 | } 19 | 20 | h3{ 21 | font-family:Courier; 22 | } 23 | 24 | p{ 25 | color:purple; 26 | } 27 | /*css comment*/ -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Classes & IDs/Sorting Friends/5.css: -------------------------------------------------------------------------------- 1 | /*Add your CSS below!*/ 2 | 3 | div { 4 | display: inline-block; 5 | margin-left: 5px; 6 | width:100px; 7 | height:100px; 8 | border-radius:100%; 9 | border:2px solid black; 10 | } 11 | 12 | .friend{ 13 | border:2px dashed #008000; 14 | } 15 | 16 | .family{ 17 | border:2px dashed #0000ff; 18 | } 19 | 20 | .enemy{ 21 | border:2px dashed #ff0000; 22 | } -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/4.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var Greeting = React.createClass({ 5 | render: function () { 6 | return

Hi there, {this.props.firstName}!

; 7 | } 8 | }); 9 | 10 | // ReactDOM.render goes here: 11 | ReactDOM.render( 12 | , 13 | document.getElementById('app') 14 | ); 15 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/6-Greeting.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var Greeting = React.createClass({ 5 | render: function () { 6 | if (this.props.signedIn == false) { 7 | return

GO AWAY

; 8 | } else { 9 | return

Hi there, {this.props.name}!

; 10 | } 11 | } 12 | }); 13 | 14 | module.exports = Greeting; 15 | -------------------------------------------------------------------------------- /Web-Development/jQuery/jQuery Effects/9.css: -------------------------------------------------------------------------------- 1 | ol { 2 | list-style-type: none; 3 | position: relative; 4 | left: -20px; 5 | } 6 | 7 | ol li { 8 | background: #eeeeee; 9 | border-radius: 5px; 10 | border: 1px solid black; 11 | margin: 3px; 12 | padding: 0.4em; 13 | font-size: 1em; 14 | height: 16px; 15 | font-family: Verdana, Arial, Sans-Serif; 16 | } 17 | 18 | ol .ui-selected { 19 | background: #F39814; color: white; 20 | } -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Element Positioning/17.css: -------------------------------------------------------------------------------- 1 | div { 2 | height: 100px; 3 | width: 100px; 4 | border-radius: 5px; 5 | border: 2px solid black; 6 | } 7 | 8 | #inner { 9 | height: 75px; 10 | width: 75px; 11 | background-color: #547980; 12 | /*Add your CSS here!*/ 13 | 14 | } 15 | 16 | #outer { 17 | height: 1500px; 18 | width: 150px; 19 | background-color: #45ADA8; 20 | position: absolute; 21 | margin-left: 100px; 22 | } -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/2-Components-Advanced-JSX/6.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | var Button = React.createClass({ 5 | scream: function () { 6 | alert('AAAAAAAAHHH!!!!!'); 7 | }, 8 | 9 | render: function () { 10 | return (); 11 | } 12 | }); 13 | 14 | ReactDOM.render( 18 | ); 19 | } 20 | }); 21 | 22 | module.exports = ChildClass; 23 | -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/5.rb: -------------------------------------------------------------------------------- 1 | =begin'puts' and 'print' 2 | The print command just takes whatever you give it and prints it to the screen. puts (for "put string") is slightly different: it adds a new (blank) line after the thing you want it to print. You use them like this: 3 | 4 | puts "What's up?" 5 | print "Oxnard Montalvo" 6 | No parentheses or semicolons needed! 7 | 8 | Instructions 9 | In the editor, use at least one print statement and at least one puts statement. You can print out any strings you like! (Make sure to put your strings between quotes, like this: "Hello!".) 10 | =end 11 | 12 | print "Hello, World!" 13 | 14 | puts "Hello Ruby!" 15 | puts "Welcome!" -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/14.rb: -------------------------------------------------------------------------------- 1 | # Looping with 'While' 2 | # Okay, training wheels off. Let's see your stuff! 3 | 4 | # i = 3 5 | # while i > 0 do 6 | # print i 7 | # i -= 1 8 | # end 9 | # In the above example, we create a variable called i and set it to 3. 10 | # Then, we print out 321 since we execute the loop so long as i is positive. 11 | # Instructions 12 | # Use a while loop to print out the numbers 1 through 50, inclusive. While the example above counts down, you will want to count up. 13 | 14 | # Use print rather than puts, and don't forget to increment your variable. 15 | 16 | i = 1 17 | while i <= 50 do 18 | print i 19 | i += 1 20 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/7- Data Structures/9.rb: -------------------------------------------------------------------------------- 1 | # Accessing Hash Values 2 | # You can access values in a hash just like an array. 3 | 4 | # pets = { 5 | # "Stevie" => "cat", 6 | # "Bowser" => "hamster", 7 | # "Kevin Sorbo" => "fish" 8 | # } 9 | 10 | # puts pets["Stevie"] 11 | # # will print "cat" 12 | # In the example above, we create a hash called pets. 13 | # Then we print cat by accessing the key "Stevie" in the `pets hash. 14 | # Instructions 15 | # Access the key-value pair you added to pets, just like step 2 in the example above. 16 | # Use puts to print that value to the console. 17 | 18 | pets = Hash.new 19 | 20 | pets["Wolfie"] = "dog" 21 | 22 | puts pets["Wolfie"] -------------------------------------------------------------------------------- /Python/Tutorials/Advanced-Topics/lists2.py: -------------------------------------------------------------------------------- 1 | # Stride Length A positive stride length traverses the list from left to right, 2 | # and a negative one traverses the list from right to left. 3 | 4 | # Further, a stride length of 1 traverses the list "by ones," a stride length of 2 5 | # traverses the list "by twos," and so on. 6 | 7 | # Instructions Create a variable, backwards_by_tens, and set it equal to the 8 | # result of going backwards through to_one_hundred by tens. Go ahead and print 9 | # backwards_by_tens to the console. 10 | 11 | to_one_hundred = range(101) 12 | # Add your code below! 13 | 14 | backwards_by_tens = to_one_hundred[::-10] 15 | print backwards_by_tens 16 | 17 | -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/2-This.Props/5-Greeting.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | var Greeting = require('./Greeting'); 4 | 5 | var App = React.createClass({ 6 | render: function () { 7 | return ( 8 |
9 |

10 | Hullo and, "Welcome to The Newzz," "On Line!" 11 |

12 | 13 | 14 |
15 | Latest newzz: where is my phone? 16 |
17 |
18 | ); 19 | } 20 | }); 21 | 22 | ReactDOM.render( 23 | , 24 | document.getElementById('app') 25 | ); 26 | 27 | -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/8.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | The '.reverse' Method 3 | The .reverse method is called the same way .length is, but instead of asking Ruby to tell you how long a string is, it spits out a backwards version of the string you gave it. For instance, 4 | 5 | "Eric".reverse 6 | will result in 7 | 8 | "cirE" 9 | Reversing input can be useful if you want to sort a list of values from highest to lowest instead of lowest to highest. (We'll get to sorting in later lessons.) 10 | 11 | Instructions 12 | Call the .reverse method on your name. Don't forget those quotation marks around your name to make it a string! 13 | =end 14 | 15 | "Manish".reverse 16 | -------------------------------------------------------------------------------- /Python/Challenges/Practice/7.py: -------------------------------------------------------------------------------- 1 | # reverse 2 | # Great work so far! Let's practice writing some functions that work with strings. 3 | 4 | # Instructions 5 | # Define a function called reverse that takes a string textand returns that string in reverse. 6 | 7 | # For example: reverse("abcd") should return "dcba". 8 | 9 | # You may not use reversed or [::-1] to help you with this. 10 | # You may get a string containing special characters (for example, !, @, or #). 11 | 12 | def reverse(text): 13 | result = "" 14 | text = list(text) 15 | lenth = len(text) 16 | while lenth > 0: 17 | result += text[lenth - 1] 18 | lenth -= 1 19 | return result 20 | 21 | 22 | print reverse("abcd") -------------------------------------------------------------------------------- /Web-Development/PHP/Introduction_PHP/10.php: -------------------------------------------------------------------------------- 1 | ), we can also put comments in our PHP code! We do that using two forward slashes (//), like so: 3 | 4 | 8 | Instructions 9 | Go ahead and add a comment to our PHP code. It can say whatever you like! 10 | 11 | --> 12 | 13 | 14 | 15 | 16 | Oh No! 17 | 18 | 19 |

22 | 23 | -------------------------------------------------------------------------------- /Web-Development/Ruby/7- Data Structures/7.rb: -------------------------------------------------------------------------------- 1 | # Using Hash.new 2 | # What we just showed you was hash literal notation. We call it that because you literally describe what you want in the hash: you give it a name and you set it equal to a bunch of key => value pairs inside curly braces. 3 | 4 | # You can also create a hash using Hash.new, like so: 5 | 6 | # my_hash = Hash.new 7 | # Setting a variable equal to Hash.new creates a new, empty hash; it's the same as setting the variable equal to empty curly braces ({}). 8 | 9 | # Instructions 10 | # Use Hash.new to create a new hash called pets. Hash must be capitalized, or Ruby won't know what you're talking about! 11 | 12 | pets = Hash.new -------------------------------------------------------------------------------- /Python/Challenges/Practice/12.py: -------------------------------------------------------------------------------- 1 | # purify 2 | # Awesome! Now let's practice filtering a list. 3 | 4 | # Instructions 5 | # Define a function called purify that takes in a list of numbers, removes all odd numbers in the list, and returns the result. 6 | 7 | # For example, purify([1,2,3]) should return [2]. 8 | 9 | # Do not directly modify the list you are given as input; instead, return a new list with only the even numbers. 10 | 11 | # this is easy 12 | 13 | def purify(numbers): 14 | result = [] 15 | for number in numbers: 16 | if number % 2 != 0: 17 | result.append(number) 18 | for i in result: 19 | numbers.remove(i) 20 | 21 | return numbers 22 | 23 | print purify([1,2,3]) -------------------------------------------------------------------------------- /Python/Tutorials/Advanced-Topics/14.py: -------------------------------------------------------------------------------- 1 | # Try It! All right! Time to test out filter() and lambda expressions. 2 | 3 | # cubes = [x**3 for x in range(1, 11)] filter(lambda x: x % 3 == 0, cubes) The 4 | # example above is just a reminder of the syntax. 5 | 6 | # Instructions Create a list, squares, that consists of the squares of the numbers 7 | # 1 to 10. A list comprehension could be useful here! Use filter() and a lambda 8 | # expression to print out only the squares that are between 30 and 70 (inclusive). 9 | 10 | squares = [x**2 for x in range(1, 11)] 11 | 12 | print squares 13 | 14 | squares = [x**2 for x in range(1, 11)] 15 | 16 | print filter(lambda x: x>= 30 and x <= 70, squares) -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Classes & IDs/Sorting Friends/1.css: -------------------------------------------------------------------------------- 1 | div { 2 | position: relative; 3 | display: inline-block; 4 | height: 100px; 5 | width: 100px; 6 | border-radius: 100%; 7 | border: 2px solid black; 8 | margin-left: 5px; 9 | margin-top: 5px; 10 | text-align: center; 11 | } 12 | 13 | div p { 14 | position: relative; 15 | margin-top: 40px; 16 | font-size: 12px; 17 | } 18 | 19 | .friend { 20 | border: 2px dashed green; 21 | } 22 | 23 | .family { 24 | border: 2px dashed blue; 25 | } 26 | 27 | .enemy { 28 | border: 2px dashed red; 29 | } 30 | 31 | #best_friend { 32 | border: 4px solid #00C957; 33 | } 34 | 35 | #archnemesis { 36 | border: 4px solid #cc0000; 37 | } -------------------------------------------------------------------------------- /Web-Development/PHP/Control Flow/1.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 28 | 29 | -------------------------------------------------------------------------------- /Web-Development/Ruby-On-Rails/1 - Getting Started/4.md: -------------------------------------------------------------------------------- 1 | Great! We created a new controller named Pages. How did we do this? 2 | 3 | The rails generate controller Pages command generated a new controller named Pages. This created a file named app/controllers/pages_controller.rb. 4 | Inside the new Pages controller, we added a method called home. Methods in Rails controllers are also referred to as controller actions, so here we added the home action to the Pages controller. 5 | 1. 6 | Now that we have a controller, let's move on to the second part of the request/response cycle and create a route. 7 | 8 | Open config/routes.rb and underneath line 1, type: 9 | 10 | get 'welcome' => 'pages#home' -------------------------------------------------------------------------------- /Web-Development/Ruby/3-Control Flow/14.rb: -------------------------------------------------------------------------------- 1 | # If, Else, and Elsif 2 | # All right! You're all on your lonesome. (Well, not quite. We'll just leave this example here.) 3 | 4 | # a = 10 5 | # b = 11 6 | # if a < b 7 | # print "a is less than b!" 8 | # elsif b < a 9 | # print "b is less than a!" 10 | # else 11 | # print "b is equal to a!" 12 | # end 13 | # Instructions 14 | # Create an if/else statement in the editor. Make sure to include at least one elsif. Each branch of the statement should print something to the console. 15 | 16 | a = 20 17 | b = 30 18 | 19 | if a < b 20 | print "df" 21 | elsif b < a 22 | print "sf" 23 | else 24 | print "ss" 25 | end -------------------------------------------------------------------------------- /Web-Development/jQuery/Dynamic HTML/6.css: -------------------------------------------------------------------------------- 1 | #title { 2 | background-color: #C02942; 3 | border-radius: 5px; 4 | text-align: center; 5 | font-family: Verdana, Arial, Sans-Serif; 6 | color: #FFFFFF; 7 | width: 200px; 8 | height: 25px; 9 | } 10 | 11 | #text { 12 | background-color: #0B486B; 13 | border-radius: 5px; 14 | text-align: center; 15 | font-family: Vivaldi, Cursive; 16 | color: #FFFFFF; 17 | width: 200px; 18 | height: 25px; 19 | } 20 | 21 | .highlighted { 22 | -webkit-box-shadow: 0 0 8px #FFD700; 23 | -moz-box-shadow: 0 0 8px #FFD700; 24 | box-shadow: 0 0 8px #FFD700; 25 | cursor:pointer; 26 | } -------------------------------------------------------------------------------- /Python/Challenges/Practice/5.py: -------------------------------------------------------------------------------- 1 | # factorial 2 | # All right! Now we're cooking. Let's try a factorial problem. 3 | 4 | # To calculate the factorial of a non-negative integer x, just multiply all the integers from 1 through x. For example: 5 | 6 | # factorial(4) would equal 4 * 3 * 2 * 1, which is 24. 7 | # factorial(1) would equal 1. 8 | # factorial(3) would equal 3 * 2 * 1, which is 6. 9 | # Instructions 10 | # Define a function factorial that takes an integer x as input. 11 | 12 | # Calculate and return the factorial of that number. 13 | 14 | def factorial(x): 15 | result = 1 16 | while x > 0: 17 | result *= x 18 | x -= 1 19 | return result 20 | 21 | print factorial(4) -------------------------------------------------------------------------------- /Python/Tutorials/Advanced-Topics/18.py: -------------------------------------------------------------------------------- 1 | # Lambda Expressions Last but not least, let's look over some lambdas. 2 | 3 | # my_list = range(16) filter(lambda x: x % 3 == 0, my_list) We've given you 4 | # another (slightly different) garbled. Sort it out with a filter() and a lambda. 5 | 6 | # Instructions Create a new variable called message. Set it to the result of 7 | # calling filter() with the appropriate lambda that will filter out the "X"s. The 8 | # second argument will be garbled. Finally, print your message to the console. 9 | 10 | garbled = "IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX" 11 | 12 | message = filter(lambda x: x != "X", garbled) 13 | print message -------------------------------------------------------------------------------- /Web-Development/Ruby/4-Thith/7.rb: -------------------------------------------------------------------------------- 1 | # Returning the Final String—Er, "Thtring" 2 | # Home stretch—now we want to display the Daffy Duckified string to the user. You can do that using the string interpolation we learned earlier: 3 | 4 | # my_string = "muchachos" 5 | # print "Adios, #{my_string}!" 6 | # # ==> "Adios, muchachos!" 7 | # Instructions 8 | # Add a puts statement that uses string interpolation to show the user their transformed string. 9 | 10 | print "String please" 11 | user_input = gets.chomp 12 | user_input.downcase! 13 | 14 | if user_input.include?"s" 15 | user_input.gsub!(/s/, "th") 16 | else 17 | puts "There's no s in your string" 18 | end 19 | 20 | puts "String is #{user_input}!" -------------------------------------------------------------------------------- /Web-Development/jQuery/Introduction/5.html: -------------------------------------------------------------------------------- 1 | Linking Your HTML and JavaScript Files Great! Now we need to link our HTML page to our jQuery script so our jQuery magic will affect our HTML. Just like we need a 2 | tag to connect our HTML and CSS, we need a 3 | 10 | Note that the 11 | tag. Instructions Add a 16 | 19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/2-Child-Update-Parent/1-Step2.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/16. 3 | */ 4 | var React = require('react'); 5 | var ReactDOM = require('react-dom'); 6 | var ChildClass = require('./ChildClass'); 7 | 8 | var ParentClass = React.createClass({ 9 | getInitialState: function () { 10 | return { totalClicks: 0 }; 11 | }, 12 | 13 | handleClick: function () { 14 | var total = this.state.totalClicks; 15 | this.setState( 16 | { totalClicks: total + 1 } 17 | ); 18 | }, 19 | 20 | // The stateful component class passes down 21 | // handleClick to a stateless component class: 22 | render: function () { 23 | return ( 24 | 25 | ); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/3.rb: -------------------------------------------------------------------------------- 1 | # The 'Until' Loop 2 | # The complement to the while loop is the until loop. It's sort of like a backwards while: 3 | 4 | # i = 0 5 | # until i == 6 6 | # i += 1 7 | # end 8 | # puts i 9 | # In the example above, we first create a variable i and set it to zero. 10 | # Then we execute a block of code until i is equal to 6. That block of code increments i. 11 | # When i is equal to 6, the block ends. 12 | # Finally, we print 6, the value of i, to the console. 13 | # Instructions 14 | # On line 2, fill in the __ blank so that the loop breaks when counter is greater than 10. 15 | # On line 5, increment counter like we do in the example above. 16 | 17 | counter = 1 18 | until counter > 10 19 | puts counter 20 | # Add code to update 'counter' here! 21 | counter += 1 22 | end -------------------------------------------------------------------------------- /Python/Tutorials/Advanced-Topics/11.py: -------------------------------------------------------------------------------- 1 | # Practice Makes Perfect Great work! See? This list slicing business is pretty 2 | # straightforward. 3 | 4 | # Let's do one more, just to prove you really know your stuff. 5 | 6 | # Instructions Create a list, to_21, that's just the numbers from 1 to 21, 7 | # inclusive. Create a second list, odds, that contains only the odd numbers in the 8 | # to_21 list (1, 3, 5, and so on). Use list slicing for this one instead of a list 9 | # comprehension. Finally, create a third list, middle_third, that's equal to the 10 | # middle third of to_21, from 8 to 14, inclusive. 11 | 12 | to_21 = [i for i in range(1, 22)] 13 | 14 | odds = to_21[::2] 15 | 16 | print to_21 17 | print 18 | print odds 19 | 20 | #i hope this is not what they want 21 | 22 | middle_third = to_21[7:14] 23 | print middle_third -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_9.py: -------------------------------------------------------------------------------- 1 | # Iterating over a list in a function 2 | # Now that we've learned about range, we have two ways of iterating through a list. 3 | 4 | # Method 1 - for item in list: 5 | 6 | # for item in list: 7 | # print item 8 | # Method 2 - iterate through indexes: 9 | 10 | # for i in range(len(list)): 11 | # print list[i] 12 | # Method 1 is useful to loop through the list, but it's not possible to modify the list this way. 13 | # Method 2 uses indexes to loop through the list, making it possible to also modify the list if needed. Since we aren't modifying the list, feel free to use either one on this lesson! 14 | 15 | n = [3, 5, 7] 16 | 17 | def total(numbers): 18 | result = 0 19 | for i in range(len(numbers)): 20 | result += numbers[i] 21 | return result -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/12.rb: -------------------------------------------------------------------------------- 1 | # Naming Conventions 2 | # There are many different kinds of variables you'll encounter as you progress through these courses, but right now we're just concerned with regular old local variables. By convention, these variables should start with a lowercase letter and words should be separated by underscores, like counter and masterful_method. Ruby won't stop you from starting your local variables with other symbols, such as capital letters, $s, or @s, but by convention these mean different things, so it's best to avoid confusion by doing what the Ruby community does. 3 | 4 | # Instructions 5 | # Create a variable name in the editor and set it equal to your name as a string (between quotes, like this: "Eric"). Your string can be capitalized, but name should be all lower case! 6 | 7 | name = "Manish" -------------------------------------------------------------------------------- /Web-Development/jQuery/jQuery Events/3.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | Kapow! 11 | 12 | 19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML_Structure_1/HTML_Basics_2/15.html: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | Some nice practice 18 | 19 | 20 |

Hey, don't say that!

21 |

I am so tired.

22 | 23 | -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/6.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | Everything in Ruby is an Object 3 | Because everything in Ruby is an object (more on this later), everything in Ruby has certain built-in abilities called methods. You can think of methods as "skills" that certain objects have. For instance, strings (words or phrases) have built-in methods that can tell you the length of the string, reverse the string, and more. 4 | 5 | We also promised to tell you more about the interpreter. The interpreter is the program that takes the code you write and runs it. You type code in the editor, the interpreter reads your code, and it shows you the result of running your code in the console (the bottom window on the right). 6 | 7 | Instructions 8 | Enough small talk. Click Save & Submit Code to start learning about string methods!=end 9 | 10 | -------------------------------------------------------------------------------- /Web-Development/Ruby/7- Data Structures/16.rb: -------------------------------------------------------------------------------- 1 | # Iterating Over a Hash 2 | # We've done a fair amount of iteration over arrays, so to finish up, let's review how to iterate over a hash. 3 | 4 | # numbers = [1, 2, 3, 4, 5] 5 | # numbers.each { |element| puts element } 6 | # Instructions 7 | # Iterate through .each key/value pair in lunch_order. 8 | # Please puts out the value of each pair (just the value, not the key). 9 | 10 | lunch_order = { 11 | "Ryan" => "wonton soup", 12 | "Eric" => "hamburger", 13 | "Jimmy" => "sandwich", 14 | "Sasha" => "salad", 15 | "Cole" => "taco" 16 | } 17 | 18 | lunch_order.each { |person,food| puts "#{food}"} 19 | 20 | 21 | # wonton soup 22 | # hamburger 23 | # sandwich 24 | # salad 25 | # taco 26 | # {"Ryan"=>"wonton soup", "Eric"=>"hamburger", "Jimmy"=>"sandwich", "Sasha"=>"salad", "Cole"=>"taco"} -------------------------------------------------------------------------------- /Web-Development/Ruby/2-Form in Formatter/4.rb: -------------------------------------------------------------------------------- 1 | # Repeat for More Input 2 | # All right! Now we need to repeat what we've done for last_name, city, and state. 3 | 4 | # Instructions 5 | # Add print prompts, variables, and gets.chomps for the user's last name, city, and state/province. Use last_name as the variable for the user's last name, city for their city, and state for their state or province. (Hint: prompt the user to provide an abbreviation for their state or province, such as "NY" for New York. This will naturally lead us to use .upcase later!) 6 | 7 | 8 | print "What's your first name?" 9 | 10 | first_name = gets.chomp 11 | 12 | print "What's your last name?" 13 | last_name = gets.chomp 14 | 15 | print "What's your city?" 16 | city = gets.chomp 17 | 18 | print "What's your state(Enter abbreviation)?" 19 | state = gets.chomp -------------------------------------------------------------------------------- /Web-Development/PHP/Arrays/5.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | Accessing Elements 17 | 18 | 19 |

20 | 24 |

25 | 26 | -------------------------------------------------------------------------------- /Web-Development/Ruby/6- Redacted/3.rb: -------------------------------------------------------------------------------- 1 | # The .split Method 2 | # Next, we'll want to divide the user's input into individual words. 3 | 4 | # Ruby has a built-in method for this called .split; it takes in a string and returns an array. If we pass it a bit of text in parentheses, .split will divide the string wherever it sees that bit of text, called a delimiter. For example, 5 | 6 | # text.split(",") 7 | # tells Ruby to split up the string text whenever it sees a comma. 8 | 9 | # Instructions 10 | # Declare a variable called words and set it equal to the result of calling the .split method on text. Pass .split a space (" ") to use as a delimiter so that we get an array made up of the words from text. 11 | 12 | puts "Enter text to search through" 13 | text = gets.chomp 14 | puts "Enter word to redact" 15 | redact = gets.chomp 16 | 17 | words = text.split(" ") -------------------------------------------------------------------------------- /Web-Development/React/React-I/2-React-Components/3-Authorization-Form-Project/6-compiled.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["6.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"6-compiled.js","sourcesContent":["// Good! Now let's give your form some s for the user to fill out.\n//\n// In between the
tags, write two tags. Give the first two attributes: type=\"password\" and placeholder=\"Password\". Give the second one attribute: type=\"submit\".\n// Stuck? Get a hint\n// 6.\n// Now let's hide the contact info.\n//\n// After your login variable, declare another variable named contactInfo. Set it equal to empty parentheses:\n//\n// var contactInfo = (\n//\n// );\n// return (\n// Cut the
    out of the return statement, and paste it in between those parentheses!\n"]} -------------------------------------------------------------------------------- /Python/Challenges/Practice/14.py: -------------------------------------------------------------------------------- 1 | # remove_duplicates 2 | # Awesome! Now for something a bit trickier. 3 | 4 | # Instructions 5 | # Write a function remove_duplicates that takes in a list and removes elements of the list that are the same. 6 | 7 | # For example: remove_duplicates([1,1,2,2]) 8 | # should return [1,2]. 9 | 10 | # Don't remove every occurrence, since you need to keep a single occurrence of a number. 11 | # The order in which you present your output does not matter. So returning [1,2,3] is the same as returning [3,1,2]. 12 | # Do not modify the list you take as input! Instead, return a new list. 13 | 14 | def remove_duplicates(numbers): 15 | result = [] #new list- this will be returned 16 | for i in numbers: 17 | if i not in result: 18 | result.append(i) 19 | return result 20 | 21 | print remove_duplicates([1,1,2,2]) 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/2-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/2016. 3 | */ 4 | 5 | var React = require('react'); 6 | 7 | var Child = React.createClass({ 8 | handleChange: function (e) { 9 | var name = e.target.value; 10 | this.props.onChange(name); 11 | }, 12 | 13 | render: function () { 14 | return ( 15 |
    16 | 24 |
    25 | ); 26 | } 27 | }); 28 | 29 | module.exports = Child; 30 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/3-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/2016. 3 | */ 4 | 5 | var React = require('react'); 6 | 7 | var Child = React.createClass({ 8 | handleChange: function (e) { 9 | var name = e.target.value; 10 | this.props.onChange(name); 11 | }, 12 | 13 | render: function () { 14 | return ( 15 |
    16 | 24 |
    25 | ); 26 | } 27 | }); 28 | 29 | module.exports = Child; 30 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/5-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/2016. 3 | */ 4 | 5 | var React = require('react'); 6 | 7 | var Child = React.createClass({ 8 | handleChange: function (e) { 9 | var name = e.target.value; 10 | this.props.onChange(name); 11 | }, 12 | 13 | render: function () { 14 | return ( 15 |
    16 | 24 |
    25 | ); 26 | } 27 | }); 28 | 29 | module.exports = Child; 30 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Element Positioning/17.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | Result 14 | 15 | 16 |
    17 | 18 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/4-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/2016. 3 | */ 4 | 5 | var React = require('react'); 6 | 7 | var Child = React.createClass({ 8 | handleChange: function (e) { 9 | var name = e.target.value; 10 | this.props.onChange(name); 11 | }, 12 | 13 | render: function () { 14 | return ( 15 |
    16 | 24 |
    25 | ); 26 | } 27 | }); 28 | 29 | module.exports = Child; 30 | 31 | -------------------------------------------------------------------------------- /Web-Development/Ruby/7- Data Structures/11.rb: -------------------------------------------------------------------------------- 1 | # Iterating Over Arrays 2 | # Iterating over arrays is easier than it looks. 3 | 4 | # numbers = [1, 2, 3, 4, 5] 5 | # numbers.each { |element| puts element } 6 | # In the example above, we create an array called numbers with 5 elements. 7 | # Then we say, "Take this array and for each element, print it to the console." As usual, we can use any placeholder name for the bit between two | | characters. 8 | # Instructions 9 | # Use the .each iterator to puts out each element of the languages array. 10 | 11 | # Make sure to use puts instead of print, so each element is on its own line. 12 | 13 | languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"] 14 | 15 | languages.each { |lang| puts lang } 16 | 17 | 18 | # HTML 19 | # CSS 20 | # JavaScript 21 | # Python 22 | # Ruby 23 | # ["HTML", "CSS", "JavaScript", "Python", "Ruby"] -------------------------------------------------------------------------------- /Web-Development/jQuery/jQuery Effects/1.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | Vanishing Act 11 | 19 | 25 | 26 | 27 |
    28 | 29 | -------------------------------------------------------------------------------- /Python/Tutorials/Loops/enumerate.py: -------------------------------------------------------------------------------- 1 | # Counting as you go 2 | # A weakness of using this for-each style of iteration is that you don't know the index of the thing you're looking at. 3 | # Generally this isn't an issue, but at times it is useful to know how far into the list you are. 4 | # Thankfully the built-in enumerate function helps with this. 5 | 6 | # enumerate works by supplying a corresponding index to each element in the list that you 7 | # pass it. Each time you go through the loop, index will be one greater, and item will be the next item 8 | # in the sequence. It's very similar to using a normal for loop with a list, 9 | # except this gives us an easy way to count how many items we've seen so far. 10 | 11 | choices = ['pizza', 'pasta', 'salad', 'nachos'] 12 | 13 | print 'Your choices are:' 14 | for index, item in enumerate(choices): 15 | print index + 1, item -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/2.js: -------------------------------------------------------------------------------- 1 | /*Fun with Functions 2 | Recall that we can add methods (i.e., functions associated with objects) to a constructor: 3 | 4 | function someObject() { 5 | 6 | this.someMethod = function() { 7 | }; 8 | 9 | } 10 | Suppose we said var someObj = new someObject();. When we call someObj.someMethod(), the code between the curly brackets { } above will run. 11 | 12 | Instructions 13 | Add a speak method to the Person constructor. Whenever speak is called, it should print "Hello!" to the console. 14 | */ 15 | 16 | function Person(job, married) { 17 | this.job = job; 18 | this.married = married; 19 | // add a "speak" method to Person! 20 | this.speak = function() { 21 | console.log("Hello!"); 22 | } 23 | 24 | } 25 | 26 | var user = new Person("Codecademy Student",false); 27 | user.speak(); -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML_Structure_1/Social_Networking_Profile/3.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | Manish Giri 13 | 14 | 15 | 16 |

    HI! My name is Manish Giri. I'm Male, 25 years old, and my home is in Calcutta, India.

    17 | 18 | -------------------------------------------------------------------------------- /Web-Development/Ruby/6- Redacted/1.rb: -------------------------------------------------------------------------------- 1 | # What You'll Be Building 2 | # Hiding information is a major part of programming: protecting passwords, establishing secure connections, and securing programs against tampering all rely on controlling access to information. 3 | 4 | # While we won't be able to really dig into information hiding until after we cover hashes in a later course, we can write a simple program to change a user's input with the tools we have now: arrays and iterators. 5 | 6 | # Instructions 7 | # Hit Save & Submit Code to test out our redactor program and to learn how to build your own. 8 | 9 | puts "Text to search through: " 10 | text = gets.chomp 11 | puts "Word to redact: " 12 | redact = gets.chomp 13 | 14 | words = text.split(" ") 15 | 16 | words.each do |word| 17 | if word != redact 18 | print word + " " 19 | else 20 | print "REDACTED " 21 | end 22 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/7.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | The '.length' Method 3 | Methods are summoned using a .. If you have a string, "I love espresso", and take the .length of it, Ruby will return the length of the string (that is, the number of characters—letters, numbers, spaces, and symbols). Check it out: 4 | 5 | "I love espresso".length 6 | # ==> 15 7 | (That little line starting with the # isn't part of what you need to write—it just shows you the output Ruby will provide. More on this in the next section!) 8 | 9 | Taking the length of input can be useful if, for example, you want to make a website that takes credit card payments. Ruby can check to make sure the credit card number appears to be valid. 10 | 11 | Instructions 12 | Call the .length method on your name (remember to use quotes around your name). 13 | =end 14 | 15 | 16 | "Manish Giri".length 17 | 18 | #11 -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/12.rb: -------------------------------------------------------------------------------- 1 | # Try It Out! 2 | # Cool, no? Now it's your turn to take the .each method for a test drive. 3 | 4 | # numbers = [1, 2, 3, 4, 5] 5 | 6 | # # one way to loop 7 | # numbers.each { |item| puts item } 8 | 9 | # # another way to loop 10 | # numbers.each do |item| 11 | # puts item 12 | # end 13 | # In the example above, we create an array called numbers. 14 | # Then we show two different ways to print each item in numbers to the console. 15 | # Instructions 16 | # Use the .each method on the odds array to print out double the value of each item of the array. In other words, multiply each item by 2. 17 | 18 | # Make sure to use print rather than puts, so your output appears on one line. 19 | 20 | # Check the Hint if you get stuck! 21 | 22 | odds = [1,3,5,7,9] 23 | 24 | # Add your code below! 25 | 26 | odds.each { |item| 27 | print item * 2 28 | } -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/6.rb: -------------------------------------------------------------------------------- 1 | # Inclusive and Exclusive Ranges 2 | # You saw a bit of new syntax in the previous exercise: for num in 1...10. What this says to Ruby is: "For the variable num in the range 1 to 10, do the following." The following was to print "#{num}", so as num took on the values of 1 to 9, one at a time, those values were printed to the console. 3 | 4 | # The reason Ruby counted to 9 and not 10 was because we used three dots in the range; this tells Ruby to exclude the final number in the count: for num in 1...10 means "go up to but don't include 10." If we use two dots, this tells Ruby to include the highest number in the range. 5 | 6 | # Instructions 7 | # Update the for loop in the editor in two ways: 8 | 9 | # Make it print the numbers 1 to 15, including 15. 10 | # Change it to use .. instead of .... 11 | 12 | for num in 1..15 13 | puts num 14 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/9- Methods, Blocks & Sorting/4.rb: -------------------------------------------------------------------------------- 1 | # Call It! 2 | # Defining a method is great, but it's not much use to you unless you call it. For example, if you call a method called cartoon_fox, Ruby will start looking for the method with that name and try to execute the code inside it. (If Ruby doesn't find a method called cartoon_fox, it will return a NameError. We'll cover errors in another lesson.) 3 | 4 | # You call a method just by typing its name. Remember when you saw us type puts_1_to_10 or greeting after our method definition in the last two exercises? That was us calling our methods! 5 | 6 | # Instructions 7 | # We've set up a function, array_of_10, in the editor to the right. Call it on line 5! 8 | 9 | def array_of_10 10 | puts (1..10).to_a 11 | end 12 | 13 | array_of_10 14 | 15 | # 1 16 | # 2 17 | # 3 18 | # 4 19 | # 5 20 | # 6 21 | # 7 22 | # 8 23 | # 9 24 | # 10 25 | # nil -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/HTML_Basics_3/13.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

    This text is black, except for the word red!

    18 | 19 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/HTML_Basics_3/2.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | Table Time 15 | 16 | 17 | 18 | 19 | 20 |
    21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML_Structure_1/HTML_Basics_2/11.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | Putting it all together 22 | 23 | 24 |

    A truly spectacular paragraph!

    25 | 26 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-HTML/Build_Own_Webpage/4.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | Let's Go!' 15 | 16 | 17 | 18 |

    MANISH GIRI

    19 |

    Hi, my name is Manish Giri.

    20 |

    I am a grad student at UC.

    21 |

    I work at UCIT.

    22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/1.rb: -------------------------------------------------------------------------------- 1 | # The 'While' Loop 2 | # Sometimes you want to repeat an action in Ruby while a certain condition is true, but you don't know how many times you'll have to repeat that action. A good example would be prompting a user for a certain type of input: if they insist on giving you the wrong thing, you may have to re-ask them several times before you get the kind of input you're looking for. 3 | 4 | # To accomplish this, we use something called a while loop. It checks to see if a certain condition is true, and while it is, the loop keeps running. As soon as the condition stops being true, the loop stops! 5 | 6 | # Instructions 7 | # Check out the code in the editor. Can you guess what it'll do? When you think you know, hit Save & Submit Code to see the results. 8 | 9 | counter = 1 10 | while counter < 11 11 | puts counter 12 | counter = counter + 1 13 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/11.rb: -------------------------------------------------------------------------------- 1 | # The .each Iterator 2 | # Great work! You're really getting the hang of this. 3 | 4 | # The loop iterator is the simplest, but also one of the least powerful. A more useful iterator is the .each method, which can apply an expression to each element of an object, one at a time. The syntax looks like this: 5 | 6 | # object.each { |item| # Do something } 7 | # You can also use the do keyword instead of {}: 8 | 9 | # object.each do |item| # Do something end 10 | # The variable name between | | can be anything you like: it's just a placeholder for each element of the object you're using .each on. 11 | 12 | # Instructions 13 | # Take a look at the code in the editor. When you're pretty sure you know what it'll do, click Save & Submit Code to test your theory. 14 | 15 | array = [1,2,3,4,5] 16 | 17 | array.each do |x| 18 | x += 10 19 | print "#{x}" 20 | end -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/Clickable_Photo_Page/3.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | My Photo Page 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
    31 | 32 | -------------------------------------------------------------------------------- /Web-Development/PHP/Functions II/1.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

    17 | $len

    "; 20 | ?> 21 |

    22 | 23 | -------------------------------------------------------------------------------- /Python/Tutorials/File-IO/5.py: -------------------------------------------------------------------------------- 1 | # Reading Between the Lines 2 | # What if we want to read from a file line by line, rather than pulling the entire file in at once. Thankfully, Python includes a readline() function that does exactly that. 3 | 4 | # If you open a file and call .readline() on the file object, you'll get the first line of the file; subsequent calls to .readline() will return successive lines. 5 | 6 | # Instructions 7 | # Declare a new variable my_file and store the result of calling open() on the "text.txt" file in "r"ead-only mode. 8 | # On three separate lines, print out the result of calling my_file.readline(). See how it gets the next line each time? 9 | # Don't forget to close() your file when you're done with it!) 10 | 11 | 12 | my_file = open("text.txt", "r") 13 | 14 | print my_file.readline() 15 | print my_file.readline() 16 | print my_file.readline() 17 | 18 | my_file.close() 19 | 20 | -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/26.js: -------------------------------------------------------------------------------- 1 | /*Passing Arguments 2 | The askTeller function has been modified within the Person class to directly give you your balance. However, it now needs the account password in order to return the bankBalance. 3 | 4 | Instructions 5 | Create a new variable called myBalance that calls the askTeller function with a password argument, 1234. 6 | 7 | */ 8 | 9 | function Person(first,last,age) { 10 | this.firstname = first; 11 | this.lastname = last; 12 | this.age = age; 13 | var bankBalance = 7500; 14 | 15 | this.askTeller = function(pass) { 16 | if (pass == 1234) return bankBalance; 17 | else return "Wrong password."; 18 | }; 19 | } 20 | 21 | var john = new Person('John','Smith',30); 22 | /* the variable myBalance should access askTeller() 23 | with a password as an argument */ 24 | var myBalance = john.askTeller(1234); -------------------------------------------------------------------------------- /Web-Development/PHP/Introduction_PHP/6.php: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

    25 | 28 |

    29 | 30 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/1.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by hi on 10/31/2016. 3 | */ 4 | /* 5 | Patterns within patterns within patterns! 6 | 7 | In lesson 1, you learned your first React programming pattern: a stateful, parent component passes down a prop to a stateless, child component. 8 | 9 | In lesson 2, you learned that lesson 1's pattern is actually part of a larger pattern: a stateful, parent component passes down an event handler to a stateless, child component. The child component then uses that event handler to update its parent's state. 10 | 11 | In this lesson, we will expand the pattern one last time. A child component updates its parent's state, and the parent passes that state to a sibling component. 12 | 13 | An understanding of this final pattern will be very helpful in the wild, not to mention in the next React course. Click Next and we'll build an example!*/ 14 | -------------------------------------------------------------------------------- /Python/Challenges/Practice/11.py: -------------------------------------------------------------------------------- 1 | # count 2 | # Great work so far. Let's finish up by practicing with a few functions that take lists as arguments. 3 | 4 | # Instructions 5 | # Define a function called count that has two arguments called sequence and item. 6 | # Return the number of times the item occurs in the list. 7 | # For example: count([1,2,1,1], 1) should return 3 (because 1 appears 3 times in the list). 8 | 9 | # There is a list method in Python that you can use for this, but you should do it the long way for practice. 10 | # Your function should return an integer. 11 | # The item you input may be an integer, string, float, or even another list! 12 | # Be careful not to use list as a variable name in your code.it's a reserved word in Python 13 | 14 | def count(sequence, item): 15 | count = 0 16 | for i in sequence: 17 | if item == i: 18 | count += 1 19 | return count 20 | 21 | print count([1,2,1,1], 1) 22 | -------------------------------------------------------------------------------- /Python/Tutorials/Introduction-Classes/8.py: -------------------------------------------------------------------------------- 1 | # A Methodical Approach 2 | # When a class has its own functions, those functions are called methods. You've already seen one such method: __init__(). But you can also define your own methods! 3 | 4 | # Instructions 5 | # Add a method, description, to your Animal class. Using two separate print statements, it should print out the name and age of the animal it's called on. Then, create an instance of Animal, hippo (with whatever name and age you like), and call its description method. 6 | 7 | class Animal(object): 8 | """Makes cute animals.""" 9 | is_alive = True 10 | def __init__(self, name, age): 11 | self.name = name 12 | self.age = age 13 | # Add your method here! 14 | def description(self): 15 | print self.name 16 | print self.age 17 | 18 | hippo = Animal("Jeff", 2) 19 | hippo.description() 20 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/3-Child-Update-Siblings/4-Parent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/2016. 3 | */ 4 | var React = require('react'); 5 | var ReactDOM = require('react-dom'); 6 | var Child = require('./Child'); 7 | var Sibling = require('./Sibling'); 8 | 9 | var Parent = React.createClass({ 10 | getInitialState: function () { 11 | return { name: 'Frarthur' }; 12 | }, 13 | 14 | changeName: function (newName) { 15 | this.setState({ 16 | name: newName 17 | }); 18 | }, 19 | 20 | render: function () { 21 | return ( 22 |
    23 | 26 | 27 |
    28 | ); 29 | } 30 | }); 31 | 32 | ReactDOM.render( 33 | , 34 | document.getElementById('app') 35 | ); 36 | -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/11.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | Multi-Line Comments 3 | You can write a comment that spans multiple lines by starting each line with a #, but there's an easier way. If you start with =begin and end with =end, everything between those two expressions will be a comment. Take a look at this example: 4 | 5 | =begin 6 | I'm a comment! 7 | I don't need any # symbols. 8 | =end 9 | 10 | =begin 11 | 12 | rescue Exception => e 13 | 14 | end 15 | Don't put any space between the = sign and the words begin or end. You can do that with math (2 + 5 is the same as 2+5), but in this case, Ruby will get confused. =begin and =end also need to be on lines all by themselves, just as shown above. 16 | 17 | Instructions 18 | Create a multi-line comment in the editor to the right. Make sure =begin and =end are on their own lines! 19 | =end 20 | 21 | =begin 22 | comment 1 23 | comment 2 24 | =end -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/15.js: -------------------------------------------------------------------------------- 1 | /*Prototype Practice 2 | Here we have created a new class, Cat, and its constructor. We also have two cats that would like to meow, but currently Cats have no meow method. 3 | 4 | Instructions 5 | Add a meow method to the Cat prototype so that all cats can now meow. This method should print to the console "Meow!". Then call this method for each cat.*/ 6 | 7 | function Cat(name, breed) { 8 | this.name = name; 9 | this.breed = breed; 10 | } 11 | 12 | // let's make some cats! 13 | var cheshire = new Cat("Cheshire Cat", "British Shorthair"); 14 | var gary = new Cat("Gary", "Domestic Shorthair"); 15 | 16 | // add a method "meow" to the Cat class that will allow 17 | // all cats to print "Meow!" to the console 18 | Cat.prototype.meow = function() { 19 | console.log("Meow!"); 20 | } 21 | 22 | // add code here to make the cats meow! 23 | cheshire.meow(); 24 | gary.meow(); 25 | -------------------------------------------------------------------------------- /Web-Development/PHP/Functions II/7.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

    16 | 25 |

    26 | 27 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/2-Child-Update-Parent/2-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/16. 3 | */ 4 | var React = require('react'); 5 | 6 | var Child = React.createClass({ 7 | render: function () { 8 | return ( 9 |
    10 |

    11 | Hey my name is {this.props.name}! 12 |

    13 | 26 |
    27 | ); 28 | } 29 | }); 30 | 31 | module.exports = Child; 32 | -------------------------------------------------------------------------------- /Web-Development/Ruby/4-Thith/4.rb: -------------------------------------------------------------------------------- 1 | # Setting Up the 'If' Branch, Part 1 2 | # All right! Time to add in a little control flow. 3 | 4 | # For the if half of our branch, we want to check whether the user's input contains an "s". 5 | 6 | # if string_to_check.include? "substring" 7 | # We can do that using Ruby's .include? method, which evaluates to true if it finds what it's looking for and false otherwise. 8 | 9 | # (As a general rule, Ruby methods that end with ? evaluate to the boolean values true or false.) 10 | 11 | # Instructions 12 | # We want to check user_input for the substring "s". 13 | 14 | # Write an if statement in the editor. It should check to see if user_input includes "s". 15 | # For now, print a string of your choice to the console if it finds "s". 16 | 17 | print "String please" 18 | user_input = gets.chomp 19 | user_input.downcase! 20 | 21 | if user_input.include?"s" 22 | print "It includes s" 23 | end -------------------------------------------------------------------------------- /Python/Tutorials/Bitwise-Operators/14.py: -------------------------------------------------------------------------------- 1 | # Slip and Slide 2 | # Finally, you can also use the left shift (<<) and right shift (>>) operators to slide masks into place. 3 | 4 | # a = 0b101 5 | # # Tenth bit mask 6 | # mask = (0b1 << 9) # One less than ten 7 | # desired = a ^ mask 8 | # Let's say that I want to turn on the 10th bit from the right of the integer a. 9 | 10 | # Instead of writing out the entire number, we slide a bit over using the << operator. 11 | 12 | # We use 9 because we only need to slide the mask nine places over from the first bit to reach the tenth bit. 13 | 14 | # Instructions 15 | # Define a function called flip_bit that takes the inputs (number, n). 16 | # Flip the nth bit (with the ones bit being the first bit) and store it in result. 17 | # Return the result of calling bin(result). 18 | 19 | def flip_bit(number, n): 20 | mask = 0b1 << n-1 21 | result = number ^ mask 22 | return bin(result) -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML-Structure-2/HTML_Basics_3/12.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | Result 13 | 14 | 15 |
    16 |
    17 |
    18 | 19 |
    20 |
    21 | 22 | -------------------------------------------------------------------------------- /Web-Development/PHP/Advanced Arrays/1.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | Array Review 15 | 16 | 17 |

    18 | 22 |

    23 | 24 | -------------------------------------------------------------------------------- /Web-Development/React/React-II/2-Child-Update-Parent/3-Child.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 10/31/16. 3 | */ 4 | 5 | var React = require('react'); 6 | 7 | var Child = React.createClass({ 8 | render: function () { 9 | return ( 10 |
    11 |

    12 | Hey my name is {this.props.name}! 13 |

    14 | 27 |
    28 | ); 29 | } 30 | }); 31 | 32 | module.exports = Child; 33 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/HTML_Structure_1/HTML_Basics_2/13.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | Sexy background color! 16 | 17 | 18 |

    Favorite Football Teams

    19 |
      20 |
    1. The Hawthorn Football Club
    2. 21 |
    3. San Franscisco 49ers
    4. 22 |
    5. Barcelona FC
    6. 23 |
    24 | 25 | -------------------------------------------------------------------------------- /Web-Development/PHP/Object Oriented PHP/1.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | OOP Review 17 | 18 | 19 |

    20 | 30 |

    31 | 32 | -------------------------------------------------------------------------------- /Web-Development/Ruby/8- Histogram/4.rb: -------------------------------------------------------------------------------- 1 | # Creating the Frequencies Hash 2 | # Good! Now we'll start counting words using a hash. 3 | 4 | # We'll want to make sure the hash has a default value. 5 | 6 | # h = Hash.new("nothing here") 7 | 8 | # puts h 9 | # # {} 10 | 11 | # puts h["kitty"] 12 | # # nothing here 13 | # In the example above, we create a new, empty hash h that has a default value of "nothing here". 14 | # Then we print out {}, the value of h, just to show that h really is empty. 15 | # Then we print out nothing here as we try to access the value stored by the key "kitty". 16 | # If you have a hash with a default value, and you try to access a non-existent key, you get that default value. 17 | 18 | # Instructions 19 | # Create a hash called frequencies in the editor. 20 | # Give it a default value of 0. 21 | 22 | puts "Enter text" 23 | text = gets.chomp 24 | 25 | words = text.split(" ") 26 | 27 | frequencies = Hash.new(0) -------------------------------------------------------------------------------- /Web-Development/jQuery/Project-ListEasy/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 11/9/2016. 3 | */ 4 | var template = function(text) { 5 | return '

    ' + text + '

    '; 6 | }; 7 | 8 | var main = function() { 9 | $('form').submit(function() { 10 | var text = $("#todo").val(); 11 | var html = template(text); 12 | $(".list").append(html); 13 | //text = ''; 14 | $("#todo").val(''); 15 | 16 | return false; 17 | }); 18 | 19 | $(document).on("click", ".glyphicon-star", function() { 20 | $(this).toggleClass("active"); 21 | }); 22 | 23 | $(document).on("click",".glyphicon-remove" , function() { 24 | //$(this).toggleClass("active"); 25 | $(this).parent().remove(); 26 | }); 27 | 28 | }; 29 | 30 | $(document).ready(main); 31 | -------------------------------------------------------------------------------- /Web-Development/Javascript/Data Structures/Contact List/final_one.js: -------------------------------------------------------------------------------- 1 | var friends = new Object(); 2 | 3 | friends.bill = new Object(); 4 | friends.steve = new Object(); 5 | 6 | friends.bill.firstName = "Bill"; 7 | friends.bill.lastName = "Gates"; 8 | friends.bill.number = "(206) 455-9899"; 9 | friends.bill.address = ['One Microsoft Way','Redmond','WA','98052']; 10 | 11 | friends.steve.firstName = "Steve"; 12 | friends.steve.lastName = "Jobs"; 13 | friends.steve.number = "(210) 455-9899"; 14 | friends.steve.address = ['One Infinite Loop','Cupertino','CA','98052']; 15 | 16 | function list(friends) { 17 | for(var key in friends) { 18 | console.log(key); 19 | } 20 | } 21 | 22 | function search(name) { 23 | for(var key in friends) { 24 | if(friends[key].firstName === name) { 25 | console.log(friends[key]); 26 | return friends[key]; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Web-Development/Ruby/3-Control Flow/5.rb: -------------------------------------------------------------------------------- 1 | # Unless 2 | # Sometimes you want to use control flow to check if something is false, rather than if it's true. You could reverse your if/else, but Ruby will do you one better: it will let you use an unless statement. 3 | 4 | # Let's say you don't want to eat unless you're hungry. That is, while you're not hungry, you write programs, but if you are hungry, you eat. You might write that program in Ruby like this: 5 | 6 | # unless hungry 7 | # # Write some sweet programs 8 | # else 9 | # # Have some noms 10 | # end 11 | # Instructions 12 | # We've started you off in the editor. Replace the ___s with the correct unless statement code so your program prints out "I'm writing Ruby programs!" 13 | 14 | hungry = false 15 | 16 | unless hungry 17 | puts "I'm writing Ruby programs!" 18 | else 19 | puts "Time to eat!" 20 | end 21 | 22 | 23 | # I'm writing Ruby programs! 24 | # nil -------------------------------------------------------------------------------- /Python/Tutorials/Loops/for_dict.py: -------------------------------------------------------------------------------- 1 | # Looping over a dictionary 2 | # You may be wondering how looping over a dictionary would work. 3 | # Would you get the key or the value? 4 | 5 | # The short answer is: you get the key which you can use to get the value. 6 | 7 | # d = {'x': 9, 'y': 10, 'z': 20} 8 | # for key in d: 9 | # if d[key] == 10 10 | # print "This dictionary has the value 10!" 11 | # First, we create a dictionary with strings as the keys and numbers as the values. 12 | # Then, we iterate through the dictionary, each time storing the key in key. 13 | # Next, we check if that key's value is equal to 10. 14 | # Finally, we print This dictionary has the value 10! 15 | # Instructions 16 | # On line 5, print the key, followed by a space, followed by the value associated with that key. 17 | 18 | d = {'a': 'apple', 'b': 'berry', 'c': 'cherry'} 19 | 20 | for key in d: 21 | # Your code here! 22 | print key, d[key] 23 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/9.rb: -------------------------------------------------------------------------------- 1 | # Next! 2 | # The next keyword can be used to skip over certain steps in the loop. For instance, if we don't want to print out the even numbers, we can write: 3 | 4 | # for i in 1..5 5 | # next if i % 2 == 0 6 | # print i 7 | # end 8 | # In the above example, we loop through the range of 1 through 5, assigning each number to i in turn. 9 | # If the remainder of i / 2 is zero, we go to the next iteration of the loop. 10 | # Then we print the value of i. This line only prints out 1, 3, and 5 because of the previous line. 11 | # Instructions 12 | # Add a line to your loop before your print statement. Use the next keyword so that you skip to the next iteration if the number i is odd. 13 | 14 | # Use the example above for help, but remember that the example above skips even numbers. 15 | 16 | i = 20 17 | loop do 18 | i -= 1 19 | next if i % 2 != 0 20 | print "#{i}" 21 | break if i <= 0 22 | end -------------------------------------------------------------------------------- /Web-Development/Ruby/1-Introduction/10.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | Single-Line Comments 3 | You probably saw us use the # sign a few times in earlier exercises. The # sign is for comments in Ruby. A comment is a bit of text that Ruby won't try to run as code: it's just for humans to read. Writing good comments not only clarifies your code for other people who may read it, but helps remind you of what you were doing when you wrote the code days, months, or even years earlier. 4 | 5 | The # sign should come before your comment and affects anything you write after it, so long as you're on a single line. (We'll show you how to do multi-line comments in a second.) Check out these examples: 6 | 7 | # I'm a full line comment! 8 | "Eric".length # I'm a comment, too! 9 | The second example will return 4, since the comment comes after the code that Ruby will execute. 10 | 11 | Instructions 12 | Write a comment in the editor. It can be anything you like!=end 13 | -------------------------------------------------------------------------------- /Web-Development/Ruby/8- Histogram/5.rb: -------------------------------------------------------------------------------- 1 | # Iterating Over the Array 2 | # Perfect! Next up: we want to iterate over words to add each word to our frequencies hash, one at a time. 3 | 4 | # colors = {"red" => 2, "blue" => 3} 5 | # colors["blue"] += 1 6 | # puts colors["blue"] 7 | # In the above example, we first create a hash mapping strings to integers. 8 | # Then, we increment the value stored by "blue" by 1. 9 | # Finally, we print out 4, the value stored by "blue". 10 | # Instructions 11 | # Use .each to iterate over the words array. 12 | # For each word we find, assume that the word itself is a key in frequencies and increment its value by 1. 13 | # This is why our default is 0. The first time we find the word, it will have a default value of 0 that we can increment up to 1. 14 | 15 | puts "Enter text" 16 | text = gets.chomp 17 | 18 | words = text.split(" ") 19 | 20 | frequencies = Hash.new(0) 21 | 22 | words.each { |word| frequencies[word] += 1 } -------------------------------------------------------------------------------- /Python/Tutorials/Bitwise-Operators/9.py: -------------------------------------------------------------------------------- 1 | # This XOR That? 2 | # The XOR (^) or exclusive or operator compares two numbers on a bit level and returns a number where the bits of that number are turned on if either of the corresponding bits of the two numbers are 1, but not both. 3 | 4 | # a: 00101010 42 5 | # b: 00001111 15 6 | # ================ 7 | # a ^ b: 00100101 37 8 | # Keep in mind that if a bit is off in both numbers, it stays off in the result. Note that XOR-ing a number with itself will always result in 0. 9 | 10 | # So remember, for every given bit in a and b: 11 | 12 | # 0 ^ 0 = 0 13 | # 0 ^ 1 = 1 14 | # 1 ^ 0 = 1 15 | # 1 ^ 1 = 0 16 | # Therefore: 17 | 18 | # 111 (7) ^ 1010 (10) = 1101 (13) 19 | # Instructions 20 | # For practice, print the result of using ^ on 0b1110 and 0b101 as a binary string. Try to do it on your own without using the ^ operator. 21 | 22 | a = 0b1110 23 | b = 0b101 24 | c = a ^ b 25 | print bin(c) -------------------------------------------------------------------------------- /Python/Tutorials/Introduction-Classes/5.py: -------------------------------------------------------------------------------- 1 | # Instantiating Your First Object 2 | # Perfect! Now we're ready to start creating objects. 3 | 4 | # We can access attributes of our objects using dot notation Here's how it works: 5 | 6 | # class Square(object): 7 | # def __init__(self): 8 | # self.sides = 4 9 | 10 | # my_shape = Square() 11 | # print my_shape.sides 12 | 13 | # First we create a class named Square with an attribute sides. 14 | # Outside the class definition, we create a new instance of Square named my_shape and access that attribute using my_shape.sides. 15 | # Instructions 16 | # Outside the Animal class definition, create a variable named zebra and set it equal to Animal("Jeffrey"). 17 | # Then print out zebra's name. 18 | # Click "Stuck? Get a hint!" for an example. 19 | 20 | class Animal(object): 21 | def __init__(self, name): 22 | self.name = name 23 | zebra = Animal("Jeffrey") 24 | print zebra.name -------------------------------------------------------------------------------- /Python/Tutorials/Bitwise-Operators/8.py: -------------------------------------------------------------------------------- 1 | # A BIT of This OR That 2 | # The bitwise OR (|) operator compares two numbers on a bit level and returns a number where the bits of that number are turned on if either of the corresponding bits of either number are 1. For example: 3 | 4 | # a: 00101010 42 5 | # b: 00001111 15 6 | # ================ 7 | # a | b: 00101111 47 8 | # Note that the bitwise | operator can only create results that are greater than or equal to the larger of the two integer inputs. 9 | 10 | # So remember, for every given bit in a and b: 11 | 12 | # 0 | 0 = 0 13 | # 0 | 1 = 1 14 | # 1 | 0 = 1 15 | # 1 | 1 = 1 16 | # Meaning 17 | 18 | # 110 (6) | 1010 (10) = 1110 (14) 19 | # Instructions 20 | # For practice, print out the result of using | on 0b1110 and 0b101 as a binary string. Try to do it on your own without using the | operator if you can help it. 21 | 22 | 23 | a = 0b1110 24 | b = 0b101 25 | c = a | b 26 | print bin(c) -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Build-Resume/5.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
    18 |
    19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Element Positioning/19.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | Result 16 | 17 | 18 |
    19 | 20 | -------------------------------------------------------------------------------- /Web-Development/jQuery/Introduction/10.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | Button Magic 12 | 24 | 29 | 30 | 31 |

    Click Me!
    32 | 33 | -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/6.js: -------------------------------------------------------------------------------- 1 | /*I.D., Please 2 | Alright! Let's get our hands dirty and start exploring some really cool stuff about objects in JavaScript. But before we can do that, how can we even tell if something is an object (as opposed to, say, a number or string)? It would be great if we could tell what type something is in JavaScript. Good thing there's a handy built-in operator to do this! 3 | 4 | Say we have a variable thing and we don't know what type thing is. We can call typeof thing to figure this out. Generally, the most useful types are "number," "string," "function," and of course, "object." 5 | 6 | As an example, the following example will print "object": 7 | 8 | var someObject = {someProperty: someValue}; 9 | console.log( typeof someObject ); 10 | Instructions 11 | In lines 3-6, we have an object, a number, and a string (in that order). Complete lines 7-9 so they will print the appropriate types of these variables.*/ 12 | 13 | -------------------------------------------------------------------------------- /Web-Development/Ruby/8- Histogram/1.rb: -------------------------------------------------------------------------------- 1 | # What You'll Be Building 2 | # In this project, we'll build a program that takes a user's input, then builds a hash from that input. Each key in the hash will be a word from the user; each value will be the number of times that word occurs. For example, if our program gets the string "the rain in Spain falls mainly on the plain," it will return 3 | 4 | # the 2 5 | # falls 1 6 | # on 1 7 | # mainly 1 8 | # in 1 9 | # rain 1 10 | # plain 1 11 | # Spain 1 12 | # A visual representation of data like this is called a histogram. 13 | 14 | # Instructions 15 | # Hit Save & Submit Code to start building your own histogram! 16 | 17 | puts "Text please: " 18 | text = gets.chomp 19 | 20 | words = text.split(" ") 21 | frequencies = Hash.new(0) 22 | words.each { |word| frequencies[word] += 1 } 23 | frequencies = frequencies.sort_by {|a, b| b } 24 | frequencies.reverse! 25 | frequencies.each { |word, frequency| puts word + " " + frequency.to_s } -------------------------------------------------------------------------------- /Web-Development/React/React-I/3-Components-Interacting/1-Components-render-other-components/2.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by manishgiri on 9/18/16. 3 | */ 4 | /*Here is a render function that returns an HTML-like JSX element: 5 | 6 | var Example = React.createClass({ 7 | render: function () { 8 | return

    Hello world

    ; 9 | } 10 | }); 11 | You've seen render functions return
    s,

    s, and

    s, just like in the above example. 12 | 13 | Render functions can also return another kind of JSX: component instances.*/ 14 | 15 | var OMG = React.createClass({ 16 | render: function () { 17 | return

    Whooaa!

    ; 18 | } 19 | }); 20 | 21 | var Crazy = React.createClass({ 22 | render: function () { 23 | return ; 24 | } 25 | }); 26 | 27 | //In the above example, Crazy's render function returns an instance of the OMG component class. You could say that Crazy renders an . 28 | 29 | -------------------------------------------------------------------------------- /Web-Development/Ruby/5- Loops & Iterators/2.rb: -------------------------------------------------------------------------------- 1 | # Danger: Infinite Loops! 2 | # Did you see that? The loop printed out the numbers 1 to 10, then stopped. This was because the loop's condition said to continue while counter was less than 11; since counter went up by 1 each time through the loop, the loop stopped when counter hit 11. 3 | 4 | # What if we'd forgotten to increment counter? It would have stayed at 1, the loop would have kept checking to see if it was less than 11 (and 1 is always less than 11), and the loop would never have ended. This is called an infinite loop and it will cause your programs to crash. Avoid them at all costs! 5 | 6 | # Instructions 7 | # The while loop in the editor is currently an infinite loop. Correct it so it will end! (Be careful—if you click Save & Submit Code right away, you'll start the infinite loop and you'll have to refresh the page.) 8 | 9 | i = 0 10 | while i < 5 11 | puts i 12 | i +=1 13 | # Add your code here! 14 | 15 | end -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Classes & IDs/CSS Selectors/16.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    20 |

    I'm the first child!

    21 |

    We're not.

    22 |

    We're not.

    23 |

    We're not.

    24 |

    We're not.

    25 |

    We're not.

    26 |

    We're not.

    27 |
    28 | 29 | 30 | 31 | /*Add your CSS below!*/ 32 | p:first-child{ 33 | font-family:cursive; 34 | } 35 | -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/6.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | Result 20 | 21 | 22 |

    I want to be SIZE 44 font!

    23 | 24 | -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/19.js: -------------------------------------------------------------------------------- 1 | /*Black (and White) Penguin Magic 2 | Now for some black magic and to see the power of inheritance! 3 | 4 | We never defined a sayName method for Penguin, but what happens when we try to call it? 5 | 6 | Instructions 7 | Create a Penguin object with the variable name penguin and any name you'd like. 8 | 9 | Then call penguin.sayName();. 10 | 11 | Then be amazed.*/ 12 | 13 | // the original Animal class and sayName method 14 | function Animal(name, numLegs) { 15 | this.name = name; 16 | this.numLegs = numLegs; 17 | } 18 | Animal.prototype.sayName = function() { 19 | console.log("Hi my name is " + this.name); 20 | }; 21 | 22 | // define a Penguin class 23 | function Penguin(name) { 24 | this.numLegs = 2; 25 | this.name = name; 26 | } 27 | 28 | // set its prototype to be a new instance of Animal 29 | Penguin.prototype = new Animal(); 30 | 31 | var penguin = new Penguin("Baha"); 32 | penguin.sayName(); -------------------------------------------------------------------------------- /Web-Development/Javascript/Objects II/28.js: -------------------------------------------------------------------------------- 1 | /*Hello? Yes, This is Dog 2 | We should all know by now what's so cool about using prototype: we can define a method for a class, and any instance of the class (i.e., object created using that class's constructor) can use that method. 3 | 4 | Remember that classes and the prototype are important to OOP! 5 | 6 | Instructions 7 | Add the sayHello method to the Dog class by extending its prototype. 8 | 9 | sayHello should print to the console: "Hello this is a [breed] dog", where [breed] is the dog's breed.*/ 10 | 11 | function Dog (breed) { 12 | this.breed = breed; 13 | }; 14 | 15 | // add the sayHello method to the Dog class 16 | // so all dogs now can say hello 17 | Dog.prototype.sayHello = function() { 18 | console.log("Hello this is a "+ this.breed +" dog"); 19 | } 20 | 21 | var yourDog = new Dog("golden retriever"); 22 | yourDog.sayHello(); 23 | 24 | var myDog = new Dog("dachshund"); 25 | myDog.sayHello(); 26 | -------------------------------------------------------------------------------- /Web-Development/PHP/While Loops/7.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | Your own do-while 12 | 13 | 14 | 15 | $num

    "; 20 | $num--; 21 | } while($num > 0); 22 | 23 | ?> 24 | 25 | -------------------------------------------------------------------------------- /Python/Challenges/Supermarket/Supermarket.py: -------------------------------------------------------------------------------- 1 | shopping_list = ["banana", "orange", "apple"] 2 | 3 | 4 | prices = { 5 | "banana":4, 6 | "apple":2, 7 | "orange":1.5, 8 | "pear":3 9 | } 10 | 11 | stock = { 12 | 13 | "banana":6, 14 | "apple":0, 15 | "orange":32, 16 | "pear":15 17 | } 18 | 19 | for key in prices: 20 | print key 21 | print "price: %s" % prices[key] 22 | print "stock: %s" % stock[key] 23 | 24 | total = 0 25 | for key in prices: 26 | tot = prices[key] * stock[key] 27 | print tot 28 | total += tot 29 | print total 30 | 31 | # Write your code below! 32 | # def compute_bill(food): 33 | # total = 0 34 | # for item in food: 35 | # total += prices[item] 36 | # return total 37 | 38 | 39 | #stocking out 40 | def compute_bill(food): 41 | total = 0 42 | for item in food: 43 | if stock[item] > 0: 44 | total += prices[item] 45 | stock[item] -= 1 46 | return total -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/Introduction-to-CSS/CSS_Overview/21.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | Result 14 | 15 | 16 |

    The below link goes to Google!

    17 | Google 18 | 19 | 20 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /Web-Development/Ruby-On-Rails/1 - Getting Started/2.md: -------------------------------------------------------------------------------- 1 | Nice work! In three commands, you built a working Rails app that displays the Rails default page. How does it work? 2 | 3 | The rails new command created a new Rails app named MySite. It generated a number of files and folders that we will use to build the app. In the Code Editor, click on the folder icon to see these files and folders. We'll see what these files and folders are for in the next exercises. The rails new command is the starting point of every Rails project. 4 | The bundle install command installed all the software packages needed by the new Rails app. These software packages are called gems and they are listed in the file Gemfile. 5 | The rails server command started the Rails development server so that we could preview the app in the browser by visiting http://localhost:8000. This development server is called WEBrick. 6 | Instructions 7 | The new Rails app contains a number of files and folders. Click Next to find out how they work together. -------------------------------------------------------------------------------- /Web-Development/Ruby/4-Thith/5.rb: -------------------------------------------------------------------------------- 1 | # Setting Up the 'If' Branch, Part 2 2 | # Good! Now let's complete our if statement. 3 | 4 | # When we find "s", we want Ruby to replace every instance of "s" it finds with "th". We can do this with the .gsub! method, which stands for global substitution. 5 | 6 | # The syntax looks like this: 7 | 8 | # string_to_change.gsub!(/s/, "th") 9 | # When we get to later lessons, we'll explain why the /s/ has to be between slashes instead of between quotes. Note: you cannot put a space between gsub! and the bit in parentheses. 10 | 11 | # Remember, you want the ! at the end of the method name so that Ruby will change the string in-place. 12 | 13 | # Instructions 14 | # Remove the print statement you added to your if statement and replace it with a call to .gsub! on user_input. Have it replace /s/ with "th". 15 | 16 | print "String please" 17 | user_input = gets.chomp 18 | user_input.downcase! 19 | 20 | if user_input.include?"s" 21 | user_input.gsub!(/s/, "th") 22 | end -------------------------------------------------------------------------------- /Python/Tutorials/Loops/while_2.py: -------------------------------------------------------------------------------- 1 | # While / else 2 | # Something completely different about Python is the while/else construction. while/else is similar to if/else, 3 | # but there is a difference: the else block will execute anytime the loop condition is evaluated to False. 4 | # This means that it will execute if the loop is never entered or if the loop exits normally. If the loop exits as the result of a break, the else will not be executed. 5 | 6 | # In this example, the loop will break if a 5 is generated, and the else will not execute. Otherwise, after 3 numbers are generated, the loop condition will become false and the else will execute 7 | 8 | import random 9 | 10 | print "Lucky Numbers! 3 numbers will be generated." 11 | print "If one of them is a '5', you lose!" 12 | 13 | count = 0 14 | while count < 3: 15 | num = random.randint(1, 6) 16 | print num 17 | if num == 5: 18 | print "Sorry, you lose!" 19 | break 20 | count += 1 21 | else: 22 | print "You win!" -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Classes & IDs/Sorting Friends/8.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | My Social Network 16 | 17 | 18 | 19 |
    20 |
    21 |
    22 | 23 | 24 | -------------------------------------------------------------------------------- /Web-Development/Ruby-On-Rails/1 - Getting Started/Project-Bolt-Network/about.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 | 7 | 8 | 9 |
    10 |
    11 |
      12 |
    • Log in
    • 13 |
    • 14 | Sign up 15 |
    • 16 |
    17 |
    18 |
    19 |
    20 | 21 |
    22 |

    About Bolt

    23 |

    Buy or rent from the largest selection of movies and TV episodes. Try it for 30 days absolutely free. After your free trial, it's only $9.99/month for unlimited streaming, anywhere you go.

    24 |
    25 |
    26 |
    27 | 28 | -------------------------------------------------------------------------------- /Web-Development/jQuery/Project-Threadly/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    10 |
    11 |

    threadly

    12 |
    13 |
    14 | 15 |
    16 |
    17 | 18 |
    19 | 20 | 21 |
    22 | 23 |
      24 |
    • Have you felt it?
    • 25 |
    • There has been an awakening.
    • 26 |
    27 |
    28 |
    29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Python/Tutorials/Lists-Functions/Lists_And_Functions_12.py: -------------------------------------------------------------------------------- 1 | # Using a list of lists in a function 2 | # Finally, this exercise shows how to make use of a single list that contains multiple lists and how to use them in a function. 3 | 4 | # list_of_lists = [[1,2,3], [4,5,6]] 5 | 6 | # for lst in list_of_lists: 7 | # for item in lst: 8 | # print item 9 | # In the example above, we first create a list containing two items, each of which is a list of numbers. 10 | # Then, we iterate through our outer list. 11 | # For each of the two inner lists (as lst), we iterate through the numbers (as item) and print them out. 12 | # We end up printing out: 13 | 14 | # 1 15 | # 2 16 | # 3 17 | # 4 18 | # 5 19 | # 6 20 | 21 | n = [[1, 2, 3], [4, 5, 6, 7, 8, 9]] 22 | # Add your function here 23 | 24 | def flatten(lists): 25 | results = [] 26 | for numbers in lists: 27 | for number in numbers: 28 | results.append(number) 29 | 30 | return results 31 | 32 | 33 | print flatten(n) -------------------------------------------------------------------------------- /Web-Development/HTML-CSS/CSS - Element Positioning/3.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | Result 14 | 15 | 16 |
    17 |
    18 |
    19 |
    20 | 21 | -------------------------------------------------------------------------------- /Web-Development/Ruby/2-Form in Formatter/2.rb: -------------------------------------------------------------------------------- 1 | # Prompting the User 2 | # First, let's write the code we're already familiar with. In order to get input from the user, we'll first need to print a prompt on the screen. 3 | 4 | # Instructions 5 | # print the question "What's your first name?" to the screen. Feel free to peek back at the first exercise if you need a syntax reminder. 6 | 7 | # Getting Input 8 | # Good! Now let's try something new. You may have noticed this weird little line of code repeated in our example: 9 | 10 | # variable_name = gets.chomp 11 | # gets is the Ruby method that gets input from the user. When getting input, Ruby automatically adds a blank line (or newline) after each bit of input; chomp removes that extra line. (Your program will work fine without chomp, but you'll get extra blank lines everywhere.) 12 | 13 | # Instructions 14 | # Declare a variable first_name and set it equal to gets.chomp. 15 | 16 | 17 | print "What's your first name?" 18 | 19 | first_name = gets.chomp --------------------------------------------------------------------------------