// HiddenMessage.tsx
import * as React from "react";
function HiddenMessage({children}) {
const [showMessage, setShowMessage] = React.useState(false)
return (
<div>
<label htmlFor="toggle">Show Message</label>
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
# Docker multistage | |
# 1. stage to run npm install | |
# 2. stage to create a webserver image with the build artifact from stage 1 | |
FROM node:latest as build-stage | |
WORKDIR /app | |
COPY ./ /app/ |
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\Tests\Unit\Playground; | |
use Attribute; | |
use PHPUnit\Framework\TestCase; | |
use ReflectionAttribute; | |
use ReflectionClass; |
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
# Remove Image | |
docker rmi <imageId/Name> | |
# Force remove image | |
docker rmi -f <imageId/Name> | |
# Remove dangling images | |
docker image prune | |
# Remove all images |
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
import { useEffect, useState } from 'react'; | |
import axios from 'axios'; | |
type State<T> = { | |
pending: boolean; | |
error?: Error; | |
data?: T; | |
}; | |
export function useGet<T>(url: 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\Command; | |
use Rx\Observable; | |
use Rx\Scheduler; | |
use Rx\Scheduler\ImmediateScheduler; | |
use Symfony\Component\Console\Attribute\AsCommand; |
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 | |
use React\EventLoop\Factory; | |
use Rx\Observable; | |
use Rx\Scheduler; | |
use Rx\Scheduler\EventLoopScheduler; | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$loop = Factory::create(); |
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); | |
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | |
use Symfony\Component\Serializer\SerializerInterface; | |
class PropertiesTest extends KernelTestCase | |
{ | |
private SerializerInterface $serializer; |
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
using Newtonsoft.Json; | |
using NUnit.Framework; | |
using System; | |
namespace JSON_empty_string_or_null_to_false_conversion | |
{ | |
public class MyDocument | |
{ | |
public bool MyFlag { get; set; } |
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
namespace Sandbox | |
{ | |
public class MyTests | |
{ | |
[Test] | |
public async Task Run_me() | |
{ | |
var numbers = new List<int> { 1, 2, 3, 5, 8 }; | |
var sum = SumAsync(numbers); |
NewerOlder