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
<? | |
function pre($array=false,$description=false,$debug_print_trace=false) { | |
$debug_trace = debug_backtrace(); | |
if($debug_print_trace){ | |
foreach(debug_backtrace() as $k=>$v){ | |
if($v['function'] == "include" || $v['function'] == "include_once" || $v['function'] == "require_once" || $v['function'] == "require"){ | |
$backtracel .= "#".$k." ".$v['function']."(".$v['args'][0].") called at [".$v['file'].":".$v['line']."]<br />"; | |
}else{ | |
$backtracel .= "#".$k." ".$v['function']."() called at [".$v['file'].":".$v['line']."]<br />"; | |
} |
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
<? | |
header ("Content-type: image/png"); | |
$code = array(); | |
$code['start'] = '1001011011010'; | |
$code['1'] = '110100101011'; | |
$code['2'] = '101100101011'; | |
$code['3'] = '110110010101'; | |
$code['4'] = '101001101011'; | |
$code['5'] = '110100110101'; | |
$code['6'] = '101100110101'; |
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
<?php | |
header("Content-Type: text/xml"); | |
$array = array ( | |
'10.10.10.10' => 'Server' | |
); | |
$xml = new SimpleXMLElement('<root/>'); | |
array_walk_recursive($array, array ($xml, 'addChild')); | |
print $xml->asXML(); | |
?> |
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
<? | |
function delTree($dir) | |
{ | |
$files = array_diff(scandir($dir), array('.','..')); | |
foreach ($files as $file) { | |
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); | |
} | |
return rmdir($dir); | |
} | |
?> |
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 TABLE new_table_name LIKE old_table_name; | |
INSERT new_table_name SELECT * FROM old_table_name; |
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
Each YouTube video has 4 generated images. They are predictably formatted as follows: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg | |
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg | |
For the high quality version of the thumbnail use a url similar to this: |
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
grep -iRI -n "base64_decode" ./ |
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
<? | |
AddEventHandler('main', 'OnBuildGlobalMenu', 'ASDOnBuildGlobalMenu'); | |
function ASDOnBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu) | |
{ | |
$arSites = array( | |
'www.site.ru' => 's1', | |
'site.ru' => 's1', | |
); | |
$arIBsites = array(); |
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
Смотрим, что у нас имеется на данный момент из устройств/разделов | |
# fdisk -l | |
Диск /dev/sda: 21.5 ГБ, 21474836480 байт | |
... | |
Устр-во Загр Начало Конец Блоки Id Система | |
/dev/sda1 * 1 64 512000 83 Linux | |
/dev/sda2 64 653 4729856 8e Linux LVM | |
/dev/sda3 653 1305 5239532+ 8e Linux LVM |
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
<?php | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); | |
$APPLICATION->SetTitle("Export"); | |
$arResult = array(); | |
$rsData = CUserTypeEntity::GetList( array("ID"=>"ASC"), array("LANG" => "ru") ); | |
while($arRes = $rsData->Fetch()) | |
{ | |
$ar_res = CUserTypeEntity::GetByID( $arRes['ID'] ); | |
$arResult[] = $ar_res; | |
} |