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 | |
// @see http://fr2.php.net/manual/en/function.mb-convert-encoding.php#103300 | |
function memory_usage() { | |
$mem_usage = memory_get_usage(true); | |
if ($mem_usage < 1024) { | |
$mem_usage .= ' bytes'; | |
} elseif ($mem_usage < 1048576) { | |
$mem_usage = round($mem_usage/1024,2) . ' kilobytes'; | |
} else { | |
$mem_usage = round($mem_usage/1048576,2) . ' megabytes'; |
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
max="$1" | |
date | |
echo "url: $2 | |
rate: $max calls / second" | |
START=$(date +%s); | |
get () { | |
curl -s -o /dev/null -w %{http_code} --max-time 3 "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log | |
} |
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
var casper = require('casper').create(); | |
var utils = require('utils'); | |
var phpMyAdminUrl = casper.cli.args[0]; | |
var phpMyAdminCredentials = { | |
pma_username: casper.cli.options.user, | |
pma_password: casper.cli.options.password | |
}; | |
if (!phpMyAdminUrl || !phpMyAdminCredentials.pma_username || !phpMyAdminCredentials.pma_password) { | |
casper.echo('Invalid parameters. Usage: casperjs monitor_slave.js http://example.com/phpMyAdmin --user=foo --password=bar'); |
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
// Created with https://checklyhq.com/docs/puppeteer-recorder/ | |
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
const navigationPromise = page.waitForNavigation() | |
await page.goto('https://demo.front-commerce.com/') |
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
import React, { useState } from "react"; | |
import logo from "./logo.svg"; | |
import "./App.css"; | |
function App() { | |
const [counter, setCounter] = useState(0); | |
const increment = () => setCounter(counter + 1); | |
const decrement = () => setCounter(counter - 1); |
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
{ | |
product(sku:"LOW-310589") { | |
name | |
imageUrl | |
giftMessageAvailable | |
sku | |
brand | |
terrangAdvice | |
isBuyableOnline | |
additionalInformation { |
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
import React from "react"; | |
import PropTypes from "prop-types"; | |
import ResizedImage from "theme/atoms/Images/ResizedImage"; | |
import ImagesGallery from "theme/molecules/Product/View/ImagesGallery"; | |
import EnhanceProductGallery from "common/enhancers/organisms/EnhanceProductGallery"; | |
import ProductGalleryQuery from "./ProductGalleryQuery.gql"; | |
import createFullUrlFromPath from "utils/createFullUrlFromPath"; | |
const ProductGallery = ({ | |
mainImageSrc, |
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
## | |
# APC recipe | |
# => convenience rules for dealing with APC in applications | |
## | |
_cset(:apc_webroot) { "" } | |
namespace :apc do | |
desc <<-DESC | |
Create a temporary PHP file to clear APC cache, call it (using curl) and removes it |
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
{ | |
"consumer": { | |
"name": "Front Commerce" | |
}, | |
"provider": { | |
"name": "Magento 2 Url" | |
}, | |
"interactions": [ | |
{ | |
"description": "A find request for entity with type category and id 6", |
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 | |
namespace Terrang\Fluxs\Test\Fake\Repository; | |
use Magento\Framework\Exception\NoSuchEntityException; | |
class FakeAddressRepository implements \Magento\Customer\Api\AddressRepositoryInterface | |
{ | |
private $db = []; |
NewerOlder