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 | |
interface AnyInterface | |
{ | |
public function anyMethod(); | |
} | |
class AnyClass implements AnyInterface | |
{ | |
public function anyMethod() |
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 | |
interface ImageInterface | |
{ | |
public function display(); | |
} | |
class Image implements ImageInterface | |
{ | |
public function __construct( |
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 | |
// Interface for states | |
interface DeploymentState | |
{ | |
public function handle(DeploymentManager $manager); | |
} | |
// Concrete state class | |
class PendingState implements DeploymentState |
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 fs from 'fs'; | |
import fsPromises from 'fs/promises'; | |
import { PDFDocument } from "pdf-lib"; | |
import QRCode from "qrcode"; | |
export const generateQR = async text => { | |
try { | |
const response = await QRCode.toDataURL(text); | |
return response; | |
} catch (err) { |
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 function Termwind\{render}; | |
use function Termwind\{style}; | |
style('my-btn')->apply('bg-blue', 'text-black'); | |
render(<<<HTML |
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 function Termwind\{render}; | |
use function Termwind\{ask}; | |
$answer = ask(<<<HTML | |
<span class="mt-1 ml-2 mr-1 bg-green px-1 text-black"> | |
What is your name? |
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 function Termwind\{render}; | |
render(<<<'HTML' | |
<div> | |
<div class="px-4 text-red-800 bg-white uppercase">Termwind</div> | |
<em class="ml-2"> |
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 { onRequest } from 'firebase-functions/v2/https'; | |
import { google } from 'googleapis'; | |
import admin from 'firebase-admin'; | |
import { setGlobalOptions } from 'firebase-functions/v2'; | |
setGlobalOptions({ | |
maxInstances: 1 | |
}); | |
admin.initializeApp(); |
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
on: push | |
name: 🚀 Deploy website on push | |
jobs: | |
web-deploy: | |
name: 🎉 Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🚚 Get latest code | |
uses: actions/checkout@v3 |
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 { onSchedule } from 'firebase-functions/v2/scheduler'; | |
import { logger } from 'firebase-functions'; | |
const sendEmailDummy = async (user) => { | |
logger.info(`Sending email to ${user.email}...`); | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
logger.info(`Email sent to ${user.email}!`); | |
resolve(); | |
}, 1000); |
NewerOlder