-
Every table should have a SINGLE, SURROGATE and NUMERIC field as the primary key. Never use logically unique fields as primary keys. For example. Do not use IDENTITY_CARD_NO as a primary key on a PERSON table.
-
In Oracle, use NUMBER (10) incremented by a sequence
-
In SQL Server/MYSQL use IDENTITY column.
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
# KEYCLOAK BASE URL | |
KEYCLOAK_BASE_URL= | |
# KEYCLOAK CLIENT SECRET | |
KEYCLOAK_CLIENT_SECRET= | |
# KEYCLOAK CLIENT ID | |
KEYCLOAK_CLIENT_ID= | |
# BASE URL FOR NEXT AUTH |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
-
Follow standard conventions.
Use CamelCase to name classes, fields and methods. DO NOT USE snake_case in code, except from defining constants.
-
Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
-
Always find root cause. Always look for the root cause of a problem.
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
mvn -Dmaven.repo.local=[path to clean .m2] -s [cleanSettings.xml] clean install |
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
begin | |
for c in( select 'ALTER SYSTEM KILL SESSION '''|| s.sid ||','||s.serial#||''' IMMEDIATE' as stmnt from v$session s where s.osuser='christoforosl' and s.sid != sid) | |
loop | |
EXECUTE IMMEDIATE c.stmnt ; | |
end loop; | |
end;/ |
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.dtph.model; | |
import java.io.PrintStream; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
/** | |
* |
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 or replace function TO_NUMBER_FROM_ROMAN_NUMERAL(p_in varchar2) | |
return number DETERMINISTIC as | |
/** adapted from https://livesql.oracle.com/apex/livesql/file/content_CESOH7H2D4O88XLW60330Q3L9.html **/ | |
v_in varchar2(200) := upper(p_in); -- upper case it | |
v_ret number(10); | |
begin | |
v_in := replace( v_in, UNISTR('\03A7'), 'X'); -- replace greek X, no need for this unless your users type in greek :-) |
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 UIKit | |
extension UICollectionView { | |
func isIndexPathAvailable(_ indexPath: IndexPath) -> Bool { | |
guard dataSource != nil, | |
indexPath.section < numberOfSections, | |
indexPath.item < numberOfItems(inSection: indexPath.section) else { | |
return false | |
} |
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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
X-WR-CALNAME:ATHENSMARAHON | |
X-WR-TIMEZONE:Europe/London | |
CALSCALE:GREGORIAN | |
BEGIN:VEVENT | |
DTSTART;VALUE=DATE:20171112 | |
DTEND;VALUE=DATE:20171112 | |
SUMMARY:Athens Marathon Date |
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.athens.marathon | |
import java.io.PrintStream; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
/** | |
* | |
* @author christoforosl |