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
git checkout -b master | |
git log -1 | |
# commit 65345471c1040ceb90b1817d7427d58d7b09fdca (HEAD -> master) | |
git checkout -b develop | |
git log -1 | |
# both branches are at the same ref: | |
# commit 65345471c1040ceb90b1817d7427d58d7b09fdca (HEAD -> develop, master) | |
echo "a feature" > feature.txt |
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
watch -n 1 cp -u -R ./source ./dest | |
# Run every seconds: `-n 1` | |
# Copy everything from "source" to "dest": | |
# `-R ./source ./dest` | |
# But only if the content is different `-u` |
Creating a login experience from the Admin with API Platform 2.6
You can use whatever authentication mode you want, but for the sake of the demonstration let's use JWT.
I'll grab a freshly downloaded api-platform distribution.
from the php container :
composer require jwt-auth
apk add openssl
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
-- The goal of this script is to trim messages that have been processed by | |
-- all extant groups from the a given Redis stream. It returns the number | |
-- of messages that were deleted from the stream, if any. I make no | |
-- guarantees about its performance, particularly if the stream is large | |
-- and not fully processed (so a simple XTRIM isn't possible). | |
-- First off, bail out early if the stream doesn't exist. | |
if redis.call("EXISTS", KEYS[1]) == 0 then | |
return false | |
end |
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('BENCH_ROUNDS', 200); | |
$start = $stop = 0.0; | |
$short = str_repeat("A", 16); | |
$long = str_repeat("A", 1 << 20); | |
$start = microtime(true); | |
for ($i = 0; $i < BENCH_ROUNDS; ++$i) { | |
sodium_crypto_pwhash_str($short, SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE); |
- Install iTerm2 from https://www.iterm2.com/
- Install oh-my-zsh from https://ohmyz.sh/ or https://github.com/robbyrussell/oh-my-zsh
- Set iTerm2 theme tab theme to Dark -
Preferences | Appearance | Tabs | Theme > Dark
- Install Fira Code fonts from https://github.com/tonsky/FiraCode (Clone and navigate to
dstr > ttf
, install all font files by double clicking) - Install Powerline fonts from https://github.com/powerline/fonts
- Set fonts for iTerm2 -
Preferences | Profiles | Text
- Change
Font
to14pt Fira code regular
and CheckUse Ligatures
checkbox - Change
Non ASCII Font
to14pt Fira mono
and CheckUse Ligatures
checkbox
- Change
- Install iTerm2 snazzy theme from https://github.com/sindresorhus/iterm2-snazzy
- Navigate to
Preferences | Profiles | Color Presets > Snazzy
- Navigate to
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 | |
namespace Acme\Foo\Infrastructure\Symfony\AppBundle\Listener; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\Console\Event\ConsoleEvent; | |
use Symfony\Component\Console\ConsoleEvents; | |
use Symfony\Component\Console\Event\ConsoleExceptionEvent; | |
use Symfony\Component\Console\Event\ConsoleTerminateEvent; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
Neither JOSE users nor JOSE library designers should be required to understand cryptography primitives. At a lower level, this can lead to badly implemented primitives. On a higher level, this can lead to reasoning by lego.
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
alias weather='curl -s wttr.in | sed -n "1,7p"' |
NewerOlder