#set($typeHintText = "$TYPE_HINT")
#set($nonTypeHintableTypes = ["", "string", "int", "mixed", "number", "void", "object", "real", "double", "float", "resource", "null", "bool", "boolean"])
#foreach($nonTypeHintableType in $nonTypeHintableTypes)
#if ($nonTypeHintableType == $TYPE_HINT)
#set($typeHintText = "")
#end
#end
#if ($typeHintText.matches('^((\\)?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+)+$'))
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 pxtoem($cible, $contexte: $base-font-size) { | |
@if $cible == 0 { @return 0 } | |
@return $cible / $contexte + 0em; | |
} |
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 | |
register_tick_function(function() { | |
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | |
$last = reset($bt); | |
echo sprintf("%s +%d\n", $last['file'], $last['line']); | |
}); | |
declare(ticks=1); |
There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.
All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.
- Loop variables are scoped outside the loop.
What do these lines do? Make predictions and then scroll down.
func print(pi *int) { fmt.Println(*pi) }
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
# All commits | |
git log --all --after="2016-01-01 00:00" --before="2017-01-01 00:00" --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short --no-merges --first-parent master --author-date-order --reverse > ~/cir/api-platform-standard-edition | |
# Commits from a specific author | |
git log --all --after="2016-01-01 00:00" --before="2017-01-01 00:00" --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short --no-merges --first-parent master --author-date-order --reverse --author="dunglas@gmail.com" |
I hereby claim:
- I am salahm on github.
- I am salahm (https://keybase.io/salahm) on keybase.
- I have a public key ASDGxm2dMmoxnD9S3c3SiU4MBb98CZBCVsNpEERlrgHN2Qo
To claim this, I am signing this object:
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 | |
$driver = $this->session->getDriver(); | |
/** @var Client $client */ | |
$client = $driver->getClient(); | |
$nbDispatchedMessages = count($client->getProfile()->getCollector('messenger')->getMessages()); | |
if ($count !== $nbDispatchedMessages) { | |
throw new ExpectationException( | |
sprintf('Dispatched messages should be equal to %s, actual : %s', $count, $nbDispatchedMessages), | |
$driver | |
); |