Skip to content

Instantly share code, notes, and snippets.

View topriddy's full-sized avatar

Temitope topriddy

View GitHub Profile
@topriddy
topriddy / main.tf
Created January 6, 2022 12:16
Sets up a minimal infra for serving a Hello World page to the public running on ec2 instance. 2hrs Terraform Quickstart tutorial
provider "aws" {
region = "us-east-1"
}
#1. Create vpc
resource "aws_vpc" "prod-vpc" {
cidr_block = "10.0.0.0/16"
tags = {
Name = "production"
@topriddy
topriddy / gist:c454d57f628804ab59a3558c2aed49f3
Created August 2, 2021 14:20
Meal Plan - This is my meal plan for my weight loss journey. Its a really simple healthy* meal plan with some cheat food.
Breakfast
- Fruit x Fibre (Cereal)
- Oats (preferable)
- 2 Tesco rolls (small bread) x 3 scrambled eggs (alternate with white eggs - yolk out)
* Breakfast/Lunch is about getting most of your calories early in the day to ensure you're less hungry in the evenings!
* To lose weight you have to be on calories deficit
* Lower carbs will help you burn body fats (need to reconfirm this but this is the thinking behind my meals)
apply plugin: 'org.ajoberstar.grgit'
task doVersioning() {
if (version == '') {
def timestamp = new Date().format("yyyyMMddHHmmss")
def githash = "${grgit.head().abbreviatedId}"
def currentBranchName = branch ?: grgit.branch.current().name
def shortBranchName = ["feature", "experiment", "spike", "bugfix", "hotfix"].find {
currentBranchName.startsWith(it)
}
@topriddy
topriddy / sum-files-challenge
Last active September 12, 2018 23:55
devslack's sum-files-challenge Java solution (Draft till when I can make it better to submit issue). Runs average of 6secs after warm up. https://github.com/devcenter-square/sum-files-challenge
package com.topriddy.devslack;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@topriddy
topriddy / AbstractDaoHibernateImpl.java
Created September 16, 2017 16:20
Sample Hibernate AbstractDAOImpl utility class from an old project 2014.
package ng.myproject.backend.dao.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import lombok.extern.log4j.Log4j;
import ng.myproject.backend.dao.Dao;
import ng.myproject.backend.entities.DomainObject;
@topriddy
topriddy / README.md
Created September 10, 2016 11:44
Steps for Integrating Jacoco in IntelliJ IDEA
  1. Integrate the dependency and plugin sections to relevant parts in your pom.xml from the pom.xml_fragment file below.
  2. Run "mvn clean package" to generate the results
  3. In IntelliJ, Select "Analyse -> Show Coverage Data..." and pick your Jacoco output file. This should be the path specified in the plug-in config i.e: ${basedir}/target/coverage-reports/jacoco-unit.exec

Output should be displayed in the IDE and you should also have the classes overlayed with test coverage.

@topriddy
topriddy / Jambito.java
Created June 27, 2012 14:17
Sample code on how to do a quick launch on click of a Blackberry Icon to browser
package com.topriddy.jambito.mobile;
import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.ui.UiApplication;
public class Jambito extends UiApplication {
private static final String START_URL ="http://www.mobilejamb.appspot.com";
public static void main(String args[]) {
BrowserSession browserSession = Browser.getDefaultSession();
@topriddy
topriddy / MapPanel.html
Created May 11, 2012 13:07
Fairly Reusable GoogleMap Wicket Component
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:wicket>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>TrackListMapPanel</title>
<wicket:head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<style type="text/css">
#map_canvas{
@topriddy
topriddy / AdditionUI.java
Created April 13, 2012 09:23
Simple example that demonstrates concept of MVC in a java app
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
@topriddy
topriddy / Student.java
Created March 23, 2012 10:05
A simple Lombok Example, documented here for peace.
package com.topriddy.app;
import lombok.Data;
import lombok.NonNull;
@Data
public class Student {
public enum Sex {MALE, FEMALE};
@NonNull private String matricNumber;