This file contains hidden or 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
DECLARE | |
TYPE TIdx IS TABLE OF BINARY_INTEGER INDEX BY VARCHAR2(20); | |
TYPE rec1_ex_TP IS RECORD | |
( | |
rec_col1 CHAR(1), | |
rec_col2 CHAR(1), | |
rec_col3 CHAR(1) | |
); | |
TYPE rec1_ex_ARRAY IS VARRAY(12) OF rec1_ex_TP; |
This file contains hidden or 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 TABLE BIG_TABLE AS SELECT level id, SYSDATE OperationDate FROM dual CONNECT BY level < 10000; | |
--DROP TABLE BIG_TABLE; | |
SELECT * FROM BIG_TABLE; | |
DECLARE | |
PROCEDURE rCleanUpOutOfDateRows | |
IS | |
-- 1.4M rows got deleted in 20 minutes | |
-- Unfortunatelly the are triggers on BIG_TABLE. | |
-- So we disable them for the time of delete wchis is safe in our case. |
This file contains hidden or 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 scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
import scala.util._ | |
val timeout = 1.seconds | |
//> timeout : scala.concurrent.duration.FiniteDuration = 1 second |
This file contains hidden or 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
def sendEmail(emailTo: String, emailFrom: String, subject: String, body: String) = { | |
import com.typesafe.plugin._ | |
val mail = use[MailerPlugin].email | |
mail.setRecipient(emailTo) | |
mail.setFrom(emailFrom) | |
mail.setSubject(subject) | |
mail.send(body) | |
} |
This file contains hidden or 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
organization := "com.gk" | |
name := "sandbox" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
libraryDependencies ++= Seq( | |
"junit" % "junit" % "4.9" % "test" withSources(), |
This file contains hidden or 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/sh | |
# PRE-COMMIT HOOK | |
# | |
# The pre-commit hook is invoked before a Subversion txn is | |
# committed. Subversion runs this hook by invoking a program | |
# (script, executable, binary, etc.) named 'pre-commit' (for which | |
# this file is a template), with the following ordered arguments: | |
# | |
# [1] REPOS-PATH (the path to this repository) |
This file contains hidden or 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.security.SecureRandom; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; | |
import java.math.BigInteger; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
/* | |
* PBKDF2 salted password hashing. | |
* Author: havoc AT defuse.ca |
This file contains hidden or 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
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<append>true</append> | |
<encoder> | |
<pattern>%date %message %n%rEx{full}</pattern> | |
</encoder> | |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
<!--log files are created in logs with name different for each day--> | |
<fileNamePattern>${application.home}/logs/app-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | |
<!--log files are created in separate folder for each day--> | |
<!--<fileNamePattern>${application.home}/logs/%d{yyyy/MM/dd}/tumrestapi-%d{yyyy-MM-dd}.%i.log</fileNamePattern>--> |
This file contains hidden or 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 | |
true=0 | |
false=1 | |
## | |
# check if the caller is the same as the owner of the current script | |
# otherwise the following problem is possible: | |
# root calls you script and creates a file with root ownership | |
# then you need root to do anythink with the file |
This file contains hidden or 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 fvGetHash512(pv_Arg IN VARCHAR2) | |
RETURN VARCHAR2 | |
IS LANGUAGE java name 'Hash512.getHash512(java.lang.String) return java.lang.String'; | |
/ | |
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Hash512" AS | |
import java.lang.*; | |
import java.security.MessageDigest; | |
public class Hash512 { | |
public static String getHash512(String arg) { |