Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
FROM node:16-alpine | |
# Set the working directory | |
WORKDIR /usr/src/app | |
# Copy package.json and package-lock.json | |
COPY package*.json ./ | |
# Install dependencies | |
RUN npm install |
version: '3.8' | |
services: | |
app: | |
container_name: examplehkbooks_app | |
build: . | |
ports: | |
- "6000:6000" | |
environment: | |
- NODE_ENV=production | |
- DATABASE_URL=mongodb://mongo:27017/hkbooks |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
<!doctype html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=0.4, maximum-scale=1"> | |
<title>Test HTML form</title> | |
</head> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB8W_JvhLDsIX_dSiWo91mhGG5jVYA1IIY&sensor=true"></script> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style type="text/css"> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0 } | |
#map_canvas { height: 100% } | |
</style> |
import sys | |
import csv | |
import httplib, urllib, base64 | |
def main(): | |
# set the name of your repository, username and password | |
username = "test" | |
password = "test" | |
repo = "test" | |
import sys | |
def shortestpath(graph,start,end,visited=[],distances={},predecessors={}): | |
"""Find the shortest path between start and end nodes in a graph""" | |
# we've found our end node, now find the path to it, and return | |
if start==end: | |
path=[] | |
while end != None: | |
path.append(end) | |
end=predecessors.get(end,None) | |
return distances[start], path[::-1] |
<?php | |
session_start(); | |
$code = $_GET["code"]; | |
$appId = $common->getAppId(); // your app id | |
$myUrl = $_SERVER['HTTP_REFERER']; | |
$appSecret = $common->secret(); //your app secret | |
if(empty($code)) { | |
$_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection | |
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" | |
. $appId . "&redirect_uri=" . urlencode($myUrl) . "&state=" |
<?php | |
public function validEmailAdd($address){ | |
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? false : true; | |
} | |
?> |