Skip to content

Instantly share code, notes, and snippets.

View janoulle's full-sized avatar

Jane Ullah janoulle

View GitHub Profile
# https://g00glen00b.be/docker-spring-boot/
# Using the alpine image as a base​
FROM openjdk:8-jdk-alpine
# maintainer
MAINTAINER "Jane Doe <janedoe@gmail.com>"
# http://blog.zot24.com/tips-tricks-with-alpine-docker/ For keeping size small
RUN apk add --no-cache curl
@janoulle
janoulle / Problem5.java
Created December 27, 2011 04:00
Problem 5 - Project Euler in Java by Jane Ullah
/**
* @author Jane Ullah
* @purpose Problem 5 - Project Euler
* @date 12/26/2011
* @site http://janetalkscode.com
*/
public class Problem5 {
public static void main(String[] args) {
int sum = 1, primeNum = 0;
<?php
//http://stackoverflow.com/questions/470617/get-current-date-and-time-in-php
//code below is from stackoverflow
$now = new DateTime();
echo $now->format('Y-m-d H:i:s'); // MySQL datetime format
echo $now->getTimestamp(); // Unix Timestamp
$now = new DateTime(null, new DateTimeZone('America/New_York'));

Keybase proof

I hereby claim:

  • I am janoulle on github.
  • I am janeullah (https://keybase.io/janeullah) on keybase.
  • I have a public key ASDNihFGZM_H4jjuu9tfececf9hctyuL54srXLDKbap6Awo

To claim this, I am signing this object:

@janoulle
janoulle / sample-docker-build.txt
Created May 6, 2018 20:43
Sample docker build command
docker build --build-arg JAR_FILE=build/libs/AppServer-0.0.1-SNAPSHOT.jar -t myapp-server:beta -f docker\myapp-server\Dockerfile .
sample docker-compose file
# Use postgres/example user/password credentials
version: '3.1'
networks:
myapp-network:
services:
@janoulle
janoulle / sample-docker-run.txt
Last active May 6, 2018 20:23
Sample docker run command
docker run -p 8080:8080 -p 8000:8000 --env-file ../Docker/myapp/environmentvariables-server.env --name myapp-server --link myapp-db --network myapp-network -v C:/Users/jane/Repositories/Docker/myapp/downloads/webpages:/usr/local/tomcat/downloads/webpages -v C:/Users/jane/Repositories/Docker/myapp/logs:/usr/local/tomcat/logs myapp-server:beta
=== Fetching app code failed
=!= Your app does not include a heroku.yml build manifest. To deploy your app, either create a heroku.yml: https://devcenter.heroku.com/articles/heroku-yml-build-manifest
Or change your stack by running: 'heroku stack:set heroku-16'
//generates image like this: $project.group/applicationName:tagVersion
task image(type: Docker, dependsOn: build ) {
project.group = '' //this prevents the generated image from having the group value added. Personal preference to do this
applicationName = "yourapp"
dockerfile = file('Dockerfile')
tagVersion = 'latest'
doFirst {
copy {
from jar
into "${stageDir}/target"

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date: