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
version: '3' | |
services: | |
client: | |
build: client | |
stdin_open: true | |
ports: | |
- 80:3000 | |
volumes: |
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
FROM python:3.8.2-alpine | |
COPY ./requirements.txt /app/requirements.txt | |
WORKDIR /app | |
RUN pip install -r requirements.txt | |
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
FROM node:13.12.0-alpine | |
WORKDIR /app | |
ENV PATH /app/node_modules/.bin:$PATH | |
COPY package.json /app | |
RUN npm install --silent | |
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 | |
/** | |
* Wizard represents an object that generates mana over time | |
*/ | |
class Wizard { | |
private $mana = 0; | |
private $last_checked = 0; |
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 | |
// uses Predis see https://github.com/nrk/predis | |
$client = new Predis\Client(); | |
// connect to the local redis server | |
$client->connect(); | |
// wait for messages on channel and print them on screen | |
echo("Waiting for messages on channel.\n"); |
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 | |
// uses Predis see https://github.com/nrk/predis | |
$client = new Predis\Client(); | |
// connect to the local redis server | |
$client->connect(); | |
// Read input from user and send to channel | |
echo "Press CTRL-C to stop.\n"; |
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 __DIR__ . '/../vendor/autoload.php'; | |
// uses Predis https://github.com/nrk/predis | |
use Predis\Client as PredisClient; | |
$user = get_user(125); | |
print_r($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 | |
// uses Predis | |
// see https://github.com/nrk/predis | |
use Predis\Client as PredisClient; | |
$client = new PredisClient(); | |
// connect to the local redis server | |
$client->connect(); |
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 | |
// uses Predis | |
// see https://github.com/nrk/predis | |
$client = new Predis\Client(); | |
// connect to the local redis server | |
$client->connect(); | |
// increment the counter in a loop | |
for($i=0;$i<10;$i++) { |
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 | |
// uses Predis https://github.com/nrk/predis | |
$client = new Predis\Client(); | |
// connect to the local redis server | |
$client->connect(); | |
// delete any existing key | |
$key = 'leaderboard'; | |
$client->del([$key]); |
NewerOlder