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 AccountLoginPage = function (chromeless, options) { | |
this.chromeless = chromeless | |
this.options = options | |
this.usernameLocator = 'input[id="Username"]' | |
this.passwordLocator = 'input[id="Password"]' | |
this.submitButtonLocator = 'form input[type="submit"]' | |
this.inputWithValidationErrorLocator = 'input.input-validation-error' | |
this.usernameRequiredValidationLocator = '.field-validation-error[data-valmsg-for="Username"]' |
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
-- First, update the attribute input type to multiselect | |
UPDATE eav_attribute SET | |
entity_type_id = 4, | |
attribute_model = NULL, | |
backend_model = 'eav/entity_attribute_backend_array', | |
backend_type = 'varchar', | |
backend_table = NULL, | |
frontend_model = NULL, | |
frontend_input = 'multiselect', | |
frontend_class = NULL |
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
SELECT c.*, p1.* | |
FROM customer c | |
JOIN purchase p1 ON (c.id = p1.customer_id) | |
LEFT OUTER JOIN purchase p2 ON (c.id = p2.customer_id AND | |
(p1.date < p2.date OR p1.date = p2.date AND p1.id < p2.id)) | |
WHERE p2.id IS NULL; |
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
$message = \Swift_Message::newInstance() | |
->setSubject('Hello Email') | |
->setFrom('send@example.com') | |
->setTo('recipient@example.com') | |
->setBody('You should see me from the profiler!') | |
; | |
$this->get('mailer')->send($message); |
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 | |
function random_password( $length = 8 ) { | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; | |
$password = substr( str_shuffle( $chars ), 0, $length ); | |
return $password; | |
} | |
?> |
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 SerialPort = require("serialport"); | |
const Readline = SerialPort.parsers.Readline; | |
var spotify = require('spotify-node-applescript'); | |
var port = new SerialPort('/dev/tty.usbmodem1422', { | |
baudRate: 115200, | |
autoOpen: false | |
}) | |
const parser = new Readline(); | |
port.pipe(parser); |
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 | |
$zipcode = $_GET[zipcode]; | |
$url = "http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=" . $zipcode; | |
$geocode = simplexml_load_file($url); | |
$city = $geocode->result->address_component[1]->long_name; | |
for ($i = 2; $i < 6; $i++) | |
{ | |
if ($geocode->result->address_component[$i]->type == "administrative_area_level_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
<div style="font-family: sans-serif;"> | |
<? var data = valid(); ?> | |
<form id="form" name="form"> | |
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?> | |
<? for (var i = 0; i < data.length; i++) { ?> | |
<? for (var j = 0; j < data[i].length; j++) { ?> | |
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br> | |
<? } ?> | |
<? } ?> | |
<? } else { ?> |
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 panel = new Ext.form.FormPanel({ | |
title: 'Example', | |
width: 350, | |
items: [], | |
listeners: { | |
add: function(me, component, index) { | |
component.on('change', function(f,n,o) { | |
alert('detected! '+f.label+' value changed from '+o+' to '+n); | |
console.log(component.startValue); | |
}); |
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
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo | |
Video: https://www.youtube.com/watch?v=xLf3OwpAFhQ | |
----------------------------------------------- | |
1) Track MySQL queries | |
vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php::query | |
vendor/magento/zendframework1/library/Zend/Db/Select.php |
OlderNewer