Skip to content

Instantly share code, notes, and snippets.

@sungitly
sungitly / email.php
Created March 20, 2014 02:07
Send Email Through SMTP (SSL) Using Zend
<?php
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mail\Transport\SmtpOptions;
use Zend\Mail\Message;
public function sendEmail($to, $subject, $body){
$message = new Message();
$message->addTo($to)
->addFrom('[email protected]')
@sungitly
sungitly / git.bash
Created March 20, 2014 02:04
Useful Git Command
git config --global credential.helper store
@sungitly
sungitly / android_resize_bitmap.java
Last active August 29, 2015 13:57
Resize bitmap in Android
Bitmap origBitmapOrig = BitmapFactory.decodeFile(imageFilePath);
//Resize the image
double width = origBitmapOrig.getWidth();
double height = origBitmapOrig.getHeight();
int newWidth = 1600
int newHeight = (int)((newWidth/width)*height);
Bitmap newBitmap = Bitmap.createScaledBitmap(origBitmapOrig, newWidth, newHeight, true);
@sungitly
sungitly / ebs_utilities.sql
Created December 5, 2013 04:09
EBS SQL Utilities
-- Setup EBS context
fnd_global.apps_initialize(user_id, responsibility_id, responsibility_application_id);
@sungitly
sungitly / oracle_utilities.sql
Created December 5, 2013 04:06
SQL Utilities for Oracle
-- PL/SQL Debugging Setup
-- See [PL/SQL Debugging Setup](http://docs.oracle.com/html/B31355_01/plsql_debugging_setup.htm). Essentially, you just need to grant necessary privileges to the user for debugging
GRANT DEBUG CONNECT SESSION TO USER
GRANT DEBUG ANY PROCEDURE TO USER
-- Find PL/SQL Definition
-- The definition of PACKAGE, PROCEDURE, TRIGGER, FUNCTION can be found in USER_SOURCE table or ALL_SOURCE table. Here is an example.
SELECT name, LISTAGG(text) WITHIN GROUP (ORDER BY line) AS plsql
FROM ALL_SOURCE
WHERE type='PROCEDURE' AND name='<procedure name in upper case>'
@sungitly
sungitly / pom.xml
Last active December 30, 2015 05:29
pom.xml file for a sandbox project
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0</version>