Skip to content

Instantly share code, notes, and snippets.

View prodeveloper's full-sized avatar

Jacob Chencha prodeveloper

View GitHub Profile
@prodeveloper
prodeveloper / introduction_functions.md
Created February 23, 2017 09:52
Introduction to functions in python

Functions are programming constructs that helps us package common operations. In addition they make our code that much more readable.

They have a format that looks like this:

def first_function():
        pass

output = first_function()
@prodeveloper
prodeveloper / introduction_loops.md
Last active February 28, 2017 04:56
An introduction to working with loops and lists in python

##Step 1

In programming, recurrence happens a lot. In fact it can be said that the entire essence of programming is to automate recurring steps.

Suppose for example we needed to have python print out a list of all numbers between 1-10 how would we do it?

Lets first create the folder for the lesson. From the terminal type in

mkdir 5lesson
@prodeveloper
prodeveloper / using_input_python.md
Last active February 21, 2017 06:20
Working with dynamic information

In previous entries we have been mostly manipulating strings and numbers. The numbers have had to be hard set inside the file.

eg

area = 5 * 3
print(area)

This is obviously useful for learning, but in real world programming. You must admit input from the users.

@prodeveloper
prodeveloper / working_scripts.md
Last active February 3, 2017 11:50
Working with Python scripts in c9

Today we will be saving our python scripts so that we can access them later.

Python scripts are text files that contain python code. Their filenames are appended with ".py

To create a script select create a new file

 photo Screen Shot 2017-02-02 at 15.50.27_zps0cinsxdq.png

Select to save the file

@prodeveloper
prodeveloper / introduction_python.md
Last active January 31, 2017 06:11
Introduction to Python

##Step 1

Open up your workspace on c9.io and activate the bash.

Type in

python3
@prodeveloper
prodeveloper / introduction_to_c9.md
Last active January 24, 2017 07:31
Introduction to C9

##Step 1

Register on c9.io

##Step 2

Select to create a new workspace

 photo Screen Shot 2017-01-22 at 10.16.03_zpsgadlnexa.png

@prodeveloper
prodeveloper / api_challenge.md
Last active October 30, 2016 16:37
Integration exercise for simple blog post

We have looked at how to create an API. In this challenge we shall be looking at how to consume one.

Based on the test data here

https://jsonplaceholder.typicode.com/posts

Create a system that displays this information in a table.

Notes:

@prodeveloper
prodeveloper / api_integration.md
Last active October 25, 2016 07:01
Basics of working with APIs

##What is an API

In previous classes, we have been using forms and tables to input and display data respectively.

This works well for pure web applications. When we want to open up our application for integration, then we need an API (Application Programming Interface).

An API allows programmatic access to your application. This means that integrations such as:

  • Mobile application
@prodeveloper
prodeveloper / migrating_laravel.md
Last active October 30, 2016 16:08
Migrating laravel installation from 5.2 to 5.3

Laravel at the moment is at version 5.3. In class we have been using Laravel 5.2.

This is a major upgrade:

  1. Laravel 5.3 has a host of upgrades to its basic services
  2. Structure of its various constructs has changed
  3. It uses PHP 5.6 or 7 as opposed to

##Step 1

@prodeveloper
prodeveloper / laravel_pagination.md
Created September 18, 2016 06:54
Pagination using laravel

Once you have your app in production. Data is guaranteed to start flowing in. As such you can no longer show all the information from a particular table at once.

Laravel provides an out of the box solution for pagination.

##Step 1:

Ensure you have enough student records so that they can be paginated. That is have at least 20 records in your students database.

You can do this by adding records using your form.