Skip to content

Instantly share code, notes, and snippets.

@tinmegali
tinmegali / ActivitySoftKeyboard.java
Last active February 19, 2016 14:52
This Generic Activity provides events to detect the presence of android's SoftKeyboard
import android.app.Activity;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
/**
* This Activity provides the possibility to register a Listener
* to monitor the SoftKeyboard presence.
@tinmegali
tinmegali / .gitattributes
Last active February 24, 2018 05:00
Using Git on Unity
# 3D models
*.3dm filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.c4d filter=lfs diff=lfs merge=lfs -text
*.collada filter=lfs diff=lfs merge=lfs -text
*.dae filter=lfs diff=lfs merge=lfs -text
*.dxf filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.jas filter=lfs diff=lfs merge=lfs -text
yarn add --exact @angular/material
yarn start

Import angular material module into src/main/webapp/app/shared/shared-libs.module.ts:

import { MaterialModule } from '@angular/material';

@NgModule({

Files in Folder

 var info = new DirectoryInfo(path);
 var fileInfo = info.GetFiles();
 for (file in fileInfo) print (file);

Creating the image

./gradlew bootRepackage -Pprod buildDocker
  • bootRepackage: Builds an executable archive (WAR) file for the application
  • -Pprod: Specifies the profile to use
  • buildDocker: Builds a docker image based on the Dockerfile present in the src/main/dockerfolder

Running the image

@tinmegali
tinmegali / CircularFragReveal.java
Last active March 15, 2019 10:28
Add a circular Reveal and Unreveal transition animation to a Android Fragment
import android.animation.Animator;
import android.animation.TimeInterpolator;
import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;

More information on Eureka documentation.

Get EurekaClient instance and call the the needed information using the micro-service name.

    @Qualifier("eurekaClient")
    @Autowired
    private EurekaClient eurekaClient;

 public String courseUrl() {
<link rel="manifest" href="manifest.webapp" />
<link rel="stylesheet" href="content/css/loading.css">
<!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->
<!-- quill style -->
\!h <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
</head>
<body>
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'fileIcon'
})
export class FileIconPipe implements PipeTransform {
transform(fileType: string): string {
switch (fileType) {
// images
// reference: https://codingexplained.com/coding/java/spring-framework/return-boolean-value-from-spring-data-jpa-query
@Repository
public interface CompanyRepository extends JpaRepository<Company, Integer> {
@Query("SELECT CASE WHEN COUNT(c) > 0 THEN true ELSE false END FROM Company c WHERE c.name = :companyName")
boolean existsByName(@Param("companyName") String companyName);
}