This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For use with git archive command: | |
# git archive --worktree-attributes --format=zip --output="$(basename "$PWD").zip" HEAD | |
* text=auto eol=lf | |
*.php diff=php | |
.editorconfig export-ignore | |
.gitattributes export-ignore | |
.gitignore export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'my_sql_encryption' | |
text = 'Sensitive data' | |
encrypted = MySQLEncryption.mysql_encrypt(text, @password) | |
decrypted = MySQLEncryption.mysql_decrypt(encrypted, @password) | |
log.info("Encrypted: #{encrypted}") | |
log.info("Decrypted: #{decrypted}") | |
expect(decrypted).to eq(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
# This module provides AES encryption compatible with MySQL AES_ENCRYPT | |
# and AES_DECRYPT functions. | |
module MySQLEncryption | |
# Takes an unencrypted text string, encrypts it with the password, | |
# and encodes the results to a hexadecimal string | |
def self.mysql_encrypt(unencrypted_text, password) | |
encrypt(unencrypted_text, mysql_key(password)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<packaging>war</packaging> | |
... | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-alpine | |
ENV TZ America/New_York | |
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime | |
RUN echo "${TZ}" > /etc/timezone | |
# Declare the working directory | |
WORKDIR /microservice | |
# Copy and explode the WAR to the working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p>Workaround to allow OpenPojo version 0.8.6 to work with Java 9.</p> | |
* <p>TODO: Remove when OpenPojo is updated</p> | |
*/ | |
@BeforeClass | |
public static void setSystemProperty() | |
{ | |
System.setProperty("sun.boot.class.path", System.getProperty("java.class.path")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
/** Find all the even divisors of a number. */ | |
class LargestModulus | |
{ | |
/** | |
* Find all the divisors for a number (a.k.a., a dividend). The number must be a positive integer. It may be provided on the command line, or entered interactively when prompted. | |
* | |
* @param args if a command line parameter is detected, the first argument is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.threeleaf.util; | |
import java.util.Comparator; | |
/** | |
* A {@link Comparator} that allows any two objects to be sorted based on {@link Object#toString()}. | |
* This works best when the object's toString returns something meaningful, but can still be | |
* useful in cases where a object one has not control over needs to be placed in a sorted | |
* collection. | |
* <p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> | |
<property name="dataSource" ref="dataSource"/> | |
<property name="persistenceUnitName" value="pu"/> | |
<property name="packagesToScan"> | |
<list> | |
<value>com.appia.model.beans</value> | |
</list> | |
</property> | |
<property name="jpaVendorAdapter"> | |
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.dongliu.apk.parser.ApkParser; | |
import net.dongliu.apk.parser.bean.Icon; | |
import org.apache.log4j.Logger; | |
import java.io.*; | |
/** Services for managing APK (Adroid Application Package) objects. */ | |
public class ApkService | |
{ | |
/** The {@link Logger}. */ |
NewerOlder