Skip to content

Instantly share code, notes, and snippets.

function down($array,$element) {
if(count($array)-1 > $element) {
$newArray = array_slice($array,0,$element,true);
$newArray[] = $array[$element+1];
$newArray[] = $array[$element];
$newArray += array_slice(
$array,
$element+2,
count($array),
@nexocentric
nexocentric / gist:7783818
Created December 4, 2013 08:00
ANSI COLOR CODES by name
Pink colors
Pink
LightPink
HotPink
DeepPink
PaleVioletRed
MediumVioletRed
Red colors
LightSalmon
Salmon
<?php
#===========================================================
# [author]
# Dodzi Y. Dzakuma
# [summary]
# This function checks if a superglobal parameter is set in
# specified superglobal. If no superglobal is specified this
# function will check the $_REQUEST superglobal by default.
# [parameters]
<!-- start scripts for auto reloading=> -->
<meta name="previousUpdateStatusList" content="">
<meta name="monitorList" content="./htdocs/cmtrend_stop.php,./htdocs/style.css,./template/cmtrend_stop.tmpl,./lib/libcommon,./lib/libcable,./lib/libpage,./lib/libcable,./conf/1217141131.00,./conf/1217141131.01,./conf/1217141131.02,./conf/1217141131.03,./conf/1217141131.04,./conf/1217141131.05,./conf/1217141131.06,./conf/1217141131.07,./conf/1217141131.08,./conf/1217141131.09">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript">
var ajaxHandlerPath = 'http://192.168.2.175/~dzakuma/update-monitor.php';
var ajaxRequest = null;
var ajaxTimeout = 300000;
function showUpdated(json)
@nexocentric
nexocentric / gist:9223248
Created February 26, 2014 03:54
functions for checking directory permissions
function checkFilePermissions($filename)
{
if(!file_exists($filename)) {
return "filename does not file_exists";
}
if(!is_file($filename)) {
return "filename does not is_file";
}
if(!is_readable($filename)) {
return "filename does not is_readable";
@nexocentric
nexocentric / gist:9636955
Created March 19, 2014 07:23
some javascripts for radio and select initalizations
//==========================================================
// [作成者]
// Dodzi Y. Dzakuma
// [概要]
// 選択されているグループステータスの初期値を設定する
// [引数]
// 1) 状況を表す整数
// [返り値]
// 無し
//==========================================================
--------------------------------------------------------
-- get a list of arguments for specifed stored procedure
--------------------------------------------------------
SELECT
argument_name,
in_out,
data_type
FROM
all_arguments
WHERE
--------------------------------------------------------
-- list all known stored procedures in oracle
--------------------------------------------------------
SELECT
owner,
object_name
FROM
dba_objects
WHERE
object_type = 'PROCEDURE'
@nexocentric
nexocentric / gist:f2f6dcf7186c117d04d6
Created October 28, 2014 18:38
Oracle SQL: Natural Numeric Sort Order By Clause
--==========================================================
-- order by natural sort order as in
-- 1, 2.. 10, 11 and not computer sort order
--==========================================================
ORDER BY
to_number(regexp_substr(CHAR_COLUMN,'^[0-9]+')),
to_number(regexp_substr(CHAR_COLUMN,'[0-9]+$')),
CHAR_COLUMN
@nexocentric
nexocentric / gist:1f7087edf126a9315f375c4efba9829c
Created March 27, 2017 18:57
Working with procedures and functions in PL/SQL
DECLARE
x VARCHAR2(8);
BEGIN
x := item_change_mapping_io.iswarehouseitem('01217');
dbms_output.put_line(x);
END;
var rc refcursor;
exec item_change_mapping_io.GetPrimaryGridData(:rc);
print rc;