Skip to content

Instantly share code, notes, and snippets.

View IEnoobong's full-sized avatar

Enoobong Ime Ibanga IEnoobong

View GitHub Profile
@IEnoobong
IEnoobong / VerifyToken.java
Last active January 23, 2017 17:10
Receive token and verify on SP gateway
package co.enoobong.rotimiphotography.backend;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
@IEnoobong
IEnoobong / Animal.java
Created May 27, 2017 16:31
Learning Classes and Objects at ALC 4.0
/**
*
* @author ienoobong
*/
public class Animal {
private int hands;
private int legs;
private int eyes;
public Animal (int hands, int legs, int eyes){
@IEnoobong
IEnoobong / introrx.md
Created June 7, 2017 12:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@IEnoobong
IEnoobong / Functional1.kt
Created November 6, 2017 09:07
Before you go all functional
val sum = (0 until Integer.MAX_VALUE)
.map { it.toLong() }
.sum()
println(sum)
@IEnoobong
IEnoobong / WorkTire.kt
Last active December 9, 2017 14:18
Works but not sustainable
class Hotel(val name: String, val address: String, val hasPool: Boolean, val hasWifi: Boolean){
override fun toString(): String {
return "Hotel(name='$name', address='$address', hasPool=$hasPool, hasWifi=$hasWifi)"
}
}
class HotelAdapter(context: Context, @LayoutRes private val layoutResource: Int, private val hotels: List<Hotel>):
ArrayAdapter<Hotel>(context, layoutResource, hotels) {
@IEnoobong
IEnoobong / CustomArrayAdapter.kt
Created December 9, 2017 14:21
A better way
class CustomArrayAdapter(context: Context,
@LayoutRes private val layoutResource: Int,
@IdRes private val textViewResourceId: Int = 0,
private val values: List<ModelDisplayName>) : ArrayAdapter<ModelDisplayName>(context, layoutResource, values) {
override fun getItem(position: Int): ModelDisplayName = values[position]
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
val view = createViewFromResource(convertView, parent, layoutResource)
@IEnoobong
IEnoobong / ModelDisplayName.kt
Created December 9, 2017 14:23
Model Display Name Interface
interface ModelDisplayName {
val displayName: String
}
@IEnoobong
IEnoobong / AddressBook.sol
Created January 24, 2024 09:59
Coinbase's Base Bootcamp codes
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
contract AddressBook is Ownable {
struct Contact {
uint id;