Skip to content

Instantly share code, notes, and snippets.

View shaunthomas999's full-sized avatar

Shaun Thomas shaunthomas999

View GitHub Profile
@shaunthomas999
shaunthomas999 / github-new-repo.md
Last active August 9, 2019 16:31
Github new repo creation - Self reference (PS: steps not complete)

Create a new repository on the command line

git init
git config user.email shaunthomas999@gmail.com
git add -A
git commit -a -m "first commit"
git remote add origin https://github.com/shaunthomas999/01_Java.git
git push -u origin master
@shaunthomas999
shaunthomas999 / My Ubuntu Settings.md
Last active May 3, 2018 17:23
Nice things to do in Ubuntu

Nice things to do in Ubuntu

Bring the Menu bar to the bottom of the window

  • Execute in Terminal > gsettings set com.canonical.Unity.Launcher launcher-position Bottom
  • To bring back the menu bar to the left side of the window > gsettings set com.canonical.Unity.Launcher launcher-position Left
  • Check this link
@shaunthomas999
shaunthomas999 / xp-api.log
Created November 28, 2017 16:47
xp-api.log
2017-11-28 17:06:03.412 INFO [something-xp-api,,,] 27445 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 9014 (http)
2017-11-28 17:06:03.413 INFO [something-xp-api,,,] 27445 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 9014
2017-11-28 17:06:03.417 INFO [something-xp-api,,,] 27445 --- [ main] n.i.securities.something.somethingXpApi : Started somethingXpApi in 8.253 seconds (JVM running for 10.796)
2017-11-28 17:09:43.496 INFO [something-xp-api,,,] 27445 --- [nio-9014-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-11-28 17:09:43.496 INFO [something-xp-api,,,] 27445 --- [nio-9014-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2017-11-28 17:09:43.536 INFO [something-xp-api,,,] 27445 --- [nio-9014-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': init
@shaunthomas999
shaunthomas999 / api-gateway.log
Created November 28, 2017 16:46
api-gateway.log
2017-11-28 16:05:53.010 INFO [api-gateway,,,] 1 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8090 (http)
2017-11-28 16:05:53.011 INFO [api-gateway,,,] 1 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8090
2017-11-28 16:05:53.015 INFO [api-gateway,,,] 1 --- [ main] n.i.s.gateway.GatewayApplication : Started GatewayApplication in 154.872 seconds (JVM running for 155.846)
2017-11-28 16:09:42.305 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-11-28 16:09:42.306 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2017-11-28 16:09:42.412 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 106 ms
2017-11-28 16:09
@shaunthomas999
shaunthomas999 / spring-boot_notes.md
Last active December 7, 2017 11:13
Spring-Boot Notes

Spring-Boot Notes

Properties

  • Option 01 - Using @Value
@Value( "${jdbc.url:aDefaultUrl}" )

AWS - Jenkins - Ubuntu - Conventional Setup

Instructions

  • Start a AWS EC2 instance and connect to that using SSH
  • Execute the following commands
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@shaunthomas999
shaunthomas999 / mockitoReference.md
Last active November 4, 2019 14:54
Mockito Reference

Usage of Mockito API

// If want to use chain method calls then use 'RETURNS_DEEP_STUBS' property
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
Foo foo = mock(Foo.class, RETURNS_DEEP_STUBS);

@Mock (answer = Answers.RETURNS_DEEP_STUBS)
private Foo foo;
@shaunthomas999
shaunthomas999 / basics.java
Last active September 1, 2017 10:20
Java Basics
// int Array initialization
int[] intArray = {1,2,3};
// String Array initialization
String[] stringArray = {"a","b","c"};
// Load resources class
File file = new File(getClass().getClassLoader().getResource(jobFileName).getFile());
// Best datatype for saving date & time - Java 8
@shaunthomas999
shaunthomas999 / passwordGenerator.js
Last active July 14, 2016 18:08
Javascript code sample. Disclaimer: This algorithem is not the best and optimised.
/*
* Password Generator
*
* @author Shaun Thomas
*
* Objective
* --
* \_ Generate 12 character length password from domain name
* \_ Re-creatable by hand without much complexity
* \_ Password has decent level of randomness