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
package requestcontext | |
type RequestLogger struct{} | |
type User struct{} | |
type RequestContextValues struct { | |
Logger RequestLogger | |
User User | |
} |
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 | |
$parentClass = 'Some\Class\Name'; | |
$anonObject = new class() extends $parentClass {}; |
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 | |
class CreativeMarket_Sniffs_Functions_FunctionLengthSniff implements PHP_CodeSniffer_Sniff | |
{ | |
const MAX_NUM_LINES = 30; | |
/** | |
* Returns an array of tokens this test wants to listen for. | |
* | |
* @return 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
if (!function_exists('debuglog')) { | |
function debuglog($message) { | |
if (!is_string($message)) { | |
$message = print_r($message, true); | |
} | |
$message .= "\n"; | |
$dir = ROOT . '/../logs/'; | |
if (!is_dir($dir)) { | |
mkdir($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
/* | |
Le browser ne trigger aucun "blur" tant que la fenêtre du browser n'est pas active. | |
Ca peut se vérifier via un simple script dans ta console que tu laisses tourner avec un compteur de "blur" | |
Du coup on s'était résiliés à une fonction helper qui injecte du JS dans la page et | |
déclenche manuellement le "blur" | |
*/ | |
function blurElement(selector) { | |
element(by.css(selector)).sendKeys(protractor.Key.TAB); // Element cannot have focus. |
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
<span translate>Hello</span> | |
<!-- This one works standard, normal, no issues --> | |
<span translate>{{ widget_title }}</span> | |
<!-- How about this case? --> |
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
/** | |
* This defines a simple widget | |
*/ | |
function simpleWidget(){}; | |
simpleWidget.$tags = [ | |
{name: 'widget', value: {width: 1, height: 1}} | |
]; | |
/** | |
* This defines a more complex one that depends on other services |
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
swiftmailer: | |
spool: { type: memory } | |
transport: smtp | |
host: mailtrap.io | |
username: xxxxxxxx | |
password: xxxxxxxx | |
encryption: ~ | |
auth_mode: plain | |
port: 2525 |
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 SomeObject = { | |
views: { | |
firstPage: _.memoize(function(){ | |
return new FirstPageView(); | |
}) // Here all we have done is declare a function | |
// This function was never executed | |
}, | |
renderFirstPage: function() { | |
var v = this.views.firstPage(); // Either the function is executed |
NewerOlder