Skip to content

Instantly share code, notes, and snippets.

View Chiamaka's full-sized avatar

Chiamaka Nwolisa Chiamaka

View GitHub Profile
//class Example to illustrate polymorphism with the + sign
class Example{
public void add(int a, int b){
System.out.println(a + b);
}
public void addStatement(int a, int b){
System.out.println("The sum of a and b is: " + (a+b));
}
}
interface Printable{
//it possesses no functonality within the methods.
//It just contains method signatures.
void Print();
void printToPDF(String filename);
}
class MyClass implements Printable{
public void Print(){
// add functionality
// abstract class BankAccount that cannot be instiatied but can be inherit by subclasses
public abstract class BankAccount{
private int accountNumber;
private String accountName;
private int balance;
public void deposit();
public void withdraw();
}
public class Vehicle{
public String color;
public int wheels;
public int engine;
public void move();
public void brake();
public void stop();
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" media="screen" title="no title">
<style media="screen">
body {
height: 100%;
[...document.querySelectorAll('.invite-card')].forEach((card) => {
const acceptBtn = card.querySelector('.bt-invite-accept');
acceptBtn.click();
});
" don't bother with vi compatibility
set nocompatible
" enable syntax highlighting
syntax enable
" configure Vundle
filetype on " without this vim emits a zero exit status, later, because of :ft off
filetype off
set rtp+=~/.vim/bundle/vundle/
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Router, Scene, Actions } from 'react-native-router-flux';
import Icon from 'react-native-vector-icons/Ionicons';
import Shows from './OnAir';
import Stations from './Stations';
const TabIcon = props => {
console.log('selected', props.selected); //undefined
return (
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import { Text, View, StatusBar, Platform, Button } from "react-native";
const MyStatusBar = ({ backgroundColor, ...props }) =>
@Chiamaka
Chiamaka / createStore.js
Created June 30, 2017 16:18
Notes on how createStore works internally
const counter = (state=0, action) => {
switch(action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
default:
return state;
}
}