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
#!/bin/bash | |
from=$(cat ~/.config/sway/current_scheme) | |
if [ "$from" = "black" ]; then | |
from=black | |
to=white | |
else | |
from=white | |
to=black |
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 | |
require './vendor/autoload.php'; | |
use ApiPlatform\Core\Action\EntrypointAction; | |
use ApiPlatform\Core\Action\ExceptionAction; | |
use ApiPlatform\Core\Action\PlaceholderAction; | |
use ApiPlatform\Core\Api\IdentifiersExtractor; | |
use ApiPlatform\Core\Api\IdentifiersExtractorInterface; | |
use ApiPlatform\Core\Api\OperationType; |
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 | |
/* | |
* This file is part of the API Platform project. | |
* | |
* (c) Kévin Dunglas <dunglas@gmail.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
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
@ViewChild('vc', {read: ViewContainerRef}) vc: ViewContainerRef; | |
constructor(private _compiler: Compiler, | |
private _injector: Injector, | |
private _m: NgModuleRef<any>) { | |
} | |
ngAfterViewInit() { | |
const template = '<span>generated on the fly: {{name}}</span>'; |
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
const Promise = require('bluebird') | |
const lambdas = require('./lambdas.js') | |
// Ref: https://stackoverflow.com/questions/25817366/bluebird-promise-all-multiple-promises-completed-aggregating-success-and-rejec | |
Promise.all(lambdas.map(function(promise) { | |
// On utilise l'API reflect pour inspecter a la main nos promesses voir http://bluebirdjs.com/docs/api/reflect.html | |
// grace a ca, la promesse réussira toujours | |
return promise.reflect(); | |
})).each(function(inspection) { | |
// Ici la lambda (ou promesse) a réussi |
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 | |
/* | |
* This file is part of the API Platform project. | |
* | |
* (c) Kévin Dunglas <dunglas@gmail.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
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
{ | |
debug | |
} | |
localhost | |
file_server | |
@resource path_regexp resource ^/api/([a-z_]+)/([a-z0-9-]+)$ | |
@resources path_regexp resources ^/api/([a-z_]+)$ |
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
# To use the "confirm" target inside another target, | |
# use the " if $(MAKE) -s confirm ; " syntax. | |
mycommand: | |
@if $(MAKE) -s confirm ; then \ | |
execute_your_command_here ; \ | |
fi | |
.PHONY: mycommand | |
# The CI environment variable can be set to a non-empty string, |
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 | |
declare(strict_types=1); | |
namespace App\Metadata; | |
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface; | |
use ApiPlatform\Core\Metadata\Property\PropertyMetadata; | |
final class PropertyMetadataFactory implements PropertyMetadataFactoryInterface |
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
const { Transform } = require('stream'); | |
const http = require('http') | |
function toDataString(data) { | |
if (typeof data === 'object') return toDataString(JSON.stringify(data)); | |
return data | |
.split(/\r\n|\r|\n/) | |
.map(line => `data: ${line}\n`) | |
.join(''); | |
} |