Skip to content

Instantly share code, notes, and snippets.

View iamshanto's full-sized avatar

Samiul Amin Shanto iamshanto

View GitHub Profile
<?php
namespace Emicro\Bundle\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class LanguageSwitcherController extends Controller
{
public function switchAction(Request $request)
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$conn = oci_connect('system', 'manager', '192.168.1.4/xe');
$stid = oci_parse($conn, 'select * from HR.GREETINGS');
oci_execute($stid);
echo "<table>\n";
-- http://www.sqlbook.com/scripts/AutoGenerateCRUDStoredProcs.txt
-- #########################################################
-- Author: www.sqlbook.com
-- Copyright: (c) www.sqlbook.com. You are free to use and redistribute
-- this script as long as this comments section with the
-- author and copyright details are not altered.
-- Purpose: For a specified user defined table (or all user defined
-- tables) in the database this script generates 4 Stored
-- Procedure definitions with different Procedure name
-- suffixes:
@iamshanto
iamshanto / sql
Last active June 23, 2017 04:55
Oracle SQL
/* SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; */
time_zone := "+00:00";
CREATE TABLE BACKOFFICEINFO (
IID number(10) NOT NULL,
BACKOFFICENAME varchar2(255) NOT NULL,
BACKOFFICEADDRESS clob NOT NULL,
PRIMARY KEY (IID)
) ;
<?php
$conn = oci_connect('system', '12', '192.168.1.71/xe');
$stid = oci_parse($conn, 'select * from BININFO');
oci_execute($stid);
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
foreach ($row as $item) {
var_dump($item);
}
}
### Merge Cell
$objPHPExcel->getActiveSheet()->mergeCells('A1:C1');
#### Set Cell Widget
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
### Set Text Bold
// Full Cell
$objPHPExcel->getActiveSheet()->getStyle("A1")->getFont()->setBold(true);
public function getAuthoritativeSportsRecords()
{
$sql = "
SELECT name,
event_type,
sport_type,
level
FROM vnn_sport
";
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
--To automatically set up the Java 8 environment variables
sudo apt-get install oracle-java8-set-default
java -version
# Source http://stackoverflow.com/questions/12403662/how-to-remove-all-mysql-tables-from-the-command-line-without-drop-database-permi
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'database_name'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.460s
[INFO] Finished at: Tue Aug 25 16:15:22 BDT 2015
[INFO] Final Memory: 6M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'spring:boot' from the repositories [local (/home/samiul/.m2/repository), spring-snapshots (http://repo.spring.io/snapshot), spring-milestones (http://repo.spring.io/milestone), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]
[ERROR]