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
<?php | |
class ConvertMoneyToString { | |
private $M = array('', 'ΕΝΑ ', 'ΔΥΟ ', 'ΤΡΙΑ ', 'ΤΕΣΣΕΡΑ ', 'ΠΕΝΤΕ ', 'ΕΞΙ ', 'ΕΠΤΑ ', 'ΟΚΤΩ ', 'ΕΝΝΕΑ '); | |
private $Mf = array('', 'ΜΙΑ ', '', 'ΤΡΕΙΣ ', 'ΤΕΣΣΕΡΙΣ '); | |
private $D1 = array('ΔΕΚΑ ', 'ΕΝΤΕΚΑ ', 'ΔΩΔΕΚΑ '); | |
private $D = array('', 'ΔΕΚΑ ', 'ΕΙΚΟΣΙ ', 'ΤΡΙΑΝΤΑ ', 'ΣΑΡΑΝΤΑ ', 'ΠΕΝΗΝΤΑ ', 'ΕΞΗΝΤΑ ', 'ΕΒΔΟΜΗΝΤΑ ', 'ΟΓΔΟΝΤΑ ', 'ΕΝΝΕΝΗΝΤΑ '); | |
private $E = array('', 'ΕΚΑΤΟ', 'ΔΙΑΚΟΣΙ', 'ΤΡΙΑΚΟΣΙ', 'ΤΕΤΡΑΚΟΣΙ', 'ΠΕΝΤΑΚΟΣΙ', 'ΕΞΑΚΟΣΙ', 'ΕΠΤΑΚΟΣΙ', 'ΟΚΤΑΚΟΣΙ', 'ΕΝΝΙΑΚΟΣΙ'); | |
private $Idx = array('ΛΕΠΤΑ', 'ΕΥΡΩ', 'ΧΙΛΙΑΔΕΣ ', 'ΕΚΑΤΟΜΜΥΡΙ', 'ΔΙΣ', 'ΤΡΙΣ', 'ΤΕΤΡΑΚΙΣ ', 'ΠΕΝΤΑΚΙΣ '); |
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
<?php | |
class DifferenceInDays { | |
private $difference; | |
protected $start; | |
protected $end; | |
function __construct($startDateTime, $endDateTime) { | |
if (is_string($startDateTime)) | |
$this->start = date_create($startDateTime); |
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
:: Usage | |
:: C:/M2> delete-corrupt-dependencies.bat > files.txt | |
@echo off | |
setlocal EnableDelayedExpansion | |
set last=? | |
for /f %%I in ('dir /s /b /o:n /a-d "*.lastUpdated"') do ( | |
if !last! NEQ %%~dpI ( | |
set last=%%~dpI |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd"> | |
<profiles> | |
<profile> | |
<id>redhat-ga-repository</id> | |
<repositories> | |
<repository> | |
<id>redhat-ga-repository</id> | |
<name>Red Hat GA repository</name> | |
<url>http://maven.repository.redhat.com/ga/</url> |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<localRepository>${user.home}/.m2/repository</localRepository> | |
<profiles> | |
<profile> | |
<id>securecentral</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<!--Override the repository (and pluginRepository) "central" from the |
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
public abstract class GenericDAOImpl<T extends DomainObject, T2 extends DomainObject> implements GenericDAO<T, T2> { | |
private Class<T> type; | |
@PersistenceContext | |
protected EntityManager entityManager; | |
public GenericDAOImpl(Class<T> type) { | |
super(); | |
this.type = type; |
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
@PersistenceContext | |
EntityManager em; | |
protected Class<T> type; | |
public List<T> allEntries() { | |
CriteriaBuilder cb = em.getCriteriaBuilder(); | |
CriteriaQuery<T> cq = cb.createQuery(type); | |
Root<T> rootEntry = cq.from(type); |
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
CREATE USER "NEWUSER" PROFILE "DEFAULT" IDENTIFIED BY "newpassword" PASSWORD EXPIRE DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS"; | |
ALTER USER "NEWUSER" ACCOUNT UNLOCK; | |
-- ROLES | |
GRANT "CONNECT" TO "NEWUSER"; | |
GRANT "RESOURCE" TO "NEWUSER"; | |
-- SYSTEM PRIVILEGES | |
GRANT CREATE ROLE TO "NEWUSER"; |
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
#!/bin/bash | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz | |
sudo tar xvzf postman-linux-x64.tar.gz -C /opt | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
cat << EOF > ~/.local/share/applications/postman2.desktop | |
[Desktop Entry] | |
Name=Postman | |
GenericName=API Client |
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 org.opentsdb.client; | |
import static com.google.common.base.Preconditions.checkArgument; | |
import java.io.IOException; | |
import java.util.concurrent.TimeUnit; | |
import org.apache.commons.lang.StringUtils; | |
import org.apache.http.HeaderElement; | |
import org.apache.http.HeaderElementIterator; |
OlderNewer