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 | |
class URLBuilder | |
{ | |
private $url; | |
private $source; | |
private $medium; | |
private $campaign; | |
private $term; |
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
const chromium = require('/opt/scraper-deps/node_modules/@sparticuz/chromium'); | |
const puppeteer = require('/opt/scraper-deps/node_modules/puppeteer-core'); | |
const handler = async (event) => { | |
const title = event.title || event.queryStringParameters.title || null; | |
if (!title) { | |
return { | |
statusCode: 400, | |
body: JSON.stringify({ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>OG Image</title> | |
<style> | |
* { |
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 | |
interface AnyInterface | |
{ | |
public function anyMethod(); | |
} | |
class AnyClass implements AnyInterface | |
{ | |
public function anyMethod() |
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 | |
interface ImageInterface | |
{ | |
public function display(); | |
} | |
class Image implements ImageInterface | |
{ | |
public function __construct( |
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 | |
// Interface for states | |
interface DeploymentState | |
{ | |
public function handle(DeploymentManager $manager); | |
} | |
// Concrete state class | |
class PendingState implements DeploymentState |
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
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 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 | |
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 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 | |
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 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 | |
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"> |
NewerOlder