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 express = require('express'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const os = require('os'); | |
const app = express(); | |
const PORT = 4000; | |
// Target log directory (in home dir) | |
const logDir = path.join(os.homedir(), 'irandra-api', 'log'); |
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 | |
echo "Hello, World!"; | |
?> |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello(): | |
return "Hello, World!" |
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 | |
// ๋ฐฉ๋ช ๋ก ๋ฐ์ดํฐ ์ฝ๊ธฐ | |
$๋ฐฉ๋ช ๋กํ์ผ = "guestbook.txt"; | |
$๋ฉ์์ง๋ค = array(); | |
if (file_exists($๋ฐฉ๋ช ๋กํ์ผ)) { | |
$๋ด์ฉ = file_get_contents($๋ฐฉ๋ช ๋กํ์ผ); | |
$๋ฉ์์ง๋ค = json_decode($๋ด์ฉ, true) ?: array(); | |
} |
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 | |
if ($_POST) { | |
$์ด๋ฆ = trim($_POST['name']); | |
$์ด๋ฉ์ผ = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL); | |
$๋์ด = (int)$_POST['age']; | |
$์ฑ๋ณ = $_POST['gender'] ?? '๋ฏธ์ง์ '; | |
// ์ ํจ์ฑ ๊ฒ์ฌ | |
if (empty($์ด๋ฆ)) { | |
echo "์ด๋ฆ์ ์ ๋ ฅํด์ฃผ์ธ์."; |
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
<form method="POST" action="process.php"> | |
์ด๋ฆ: <input type="text" name="name" required><br> | |
์ด๋ฉ์ผ: <input type="email" name="email" required><br> | |
๋์ด: <input type="number" name="age" min="1" max="120"><br> | |
์ฑ๋ณ: | |
<input type="radio" name="gender" value="๋จ์ฑ"> ๋จ์ฑ | |
<input type="radio" name="gender" value="์ฌ์ฑ"> ์ฌ์ฑ<br> | |
<button type="submit">ํ์๊ฐ์ </button> | |
</form> |
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 | |
function ์ธ์ฌ($์ด๋ฆ, $์๊ฐ = "๋ฎ") { | |
if ($์๊ฐ == "์์นจ") { | |
return "์ข์ ์์นจ์ด์์, $์ด๋ฆ๋!"; | |
} elseif ($์๊ฐ == "์ ๋ ") { | |
return "์๋ ํ ์ฃผ๋ฌด์ธ์, $์ด๋ฆ๋!"; | |
} else { | |
return "์๋ ํ์ธ์, $์ด๋ฆ๋!"; | |
} | |
} |
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 | |
$ํ์๋ค = array("๋ฏผ์", "์ง์", "๋ฏผ์ค"); | |
foreach ($ํ์๋ค as $ํ์) { | |
echo "์๋ ํ์ธ์, $ํ์๋!<br>"; | |
} |
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 | |
$์์ผ = "์์์ผ"; | |
switch ($์์ผ) { | |
case "์์์ผ": | |
case "ํ์์ผ": | |
echo "์ฃผ ์ด๋ฐ์ด๋ค์, ํ์ดํ !"; | |
break; | |
case "๊ธ์์ผ": | |
echo "๋ถ๊ธ์ด๋ค!"; | |
break; |
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 | |
$์ ์ = 80; | |
if ($์ ์ >= 90) { | |
echo "์ฐ์ํฉ๊ฒฉ์ ๋๋ค!"; | |
} elseif ($์ ์ >= 70) { | |
echo "ํฉ๊ฒฉ์ ๋๋ค!"; | |
} else { | |
echo "๋ถํฉ๊ฒฉ์ ๋๋ค. ๋ค์ ๋์ ํ์ธ์!"; | |
} |
NewerOlder