Skip to content

Instantly share code, notes, and snippets.

View kabaros's full-sized avatar

Mozafar kabaros

  • nyala.dev
  • Khartoum / Glasgow
View GitHub Profile
For Students
Think about the solution before writing any code (maybe even write pseudocode, or pencil a solution)
Break bigger tasks into smaller pieces, and solve them one step at a time.
Think about your function signature
Write Test -> Write Code Implementation -> Refactor (repeat)
Use the debugger
Good functions
have good names and clear parameter names
have single responsibility
be defensive: don't trust your parameter
# For Students
- Think about the solution before writing any code (maybe even write pseudocode, or pencil a solution)
- Break bigger tasks into smaller pieces, and solve them one step at a time.
- Think about your function signature
- Write Test -> Write Code Implementation -> Refactor (repeat)
- Use the debugger
- Good functions
- have good names and clear parameter names
- have single responsibility
import React, { Component } from 'react'
import { View, Text, Button, TextInput, StyleSheet } from 'react-native'
// https://developers.google.com/places/web-service/get-api-key
const ApiKey = 'AIzaSyAl_gQqNibe6FCE_MRBUyOOsQgmZJZvAjU'
class PlaceFinder extends Component {
constructor (props) {
super(props)
this.state = {
import React, { Component } from 'react'
import {
View,
Text,
Button,
Platform,
TextInput,
StyleSheet
} from 'react-native'
import { Constants, Location, Permissions } from 'expo'
-- Add this file under your project /database folder (create it if it doesn't exist)
-- then to execute it, run the command:
-- sqlite3 database.sqlite < schema.sql
-- Run it from your terminal after navigating to /database folder
-- this will create a database file called database.sqlite
DROP TABLE IF EXISTS customers;
CREATE TABLE customers (
id INTEGER PRIMARY KEY AUTOINCREMENT,